[ic] How to create delimted text file for each order

Paul Jordan paul at gishnetwork.com
Fri Mar 10 12:47:49 EST 2006


> DB Wrote
> When an order is placed, I'd like to have a tab-delimited 
> text file created and stored on the IC server with the order 
> number as the filename (for example 1000.txt). The file 
> should use following format where {tab} and {lf} indicate 
> where I want tabs and newlines to be.
> Obviously this file contains data from both the transactions 
> and orderline tables.
> 
> 
> order_number{lf}
> fname{tab}lname{lf}
> sku_1{tab}qty_1{lf}
> ...
> sku_n{tab}qty_n{lf}
> order_total{lf}
> 
> 
> This is a very simple example, but if I could see how to do 
> this then I'm sure I could build on the example to include 
> more information in the file. Any hints are welcomed!


In etc/log_transaction there is this example:

[write-relative-file file="orders/session/[value mv_transaction_id]/[data
session id].dump" interpolate=1][dump][/write-relative-file]

It shows you how to place the file some where and name it. Now, it is just a
matter of making the contents to substitute where the above [dump] is. You
can probably write it all to a scratch var, or just repeat any iterations
directly in that tag, as it has a closing tag. I am guessing literal tabs
will translate into the file, but I could be wrong. You know, there is a
file named via its order number already? Look in <catroot>/orders/*

The [log] tag would probably suffice as well.

HTH

Paul



More information about the interchange-users mailing list