I have a csv output from a load statement and would like to append the csv file by adding a row at the end of the csv file but cannot think of a way.
this is my load statement
Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price
resident Temp;
Let vOutputfilename=Replace('Catalogue $(vContract) '&today()&'.csv','/','-');
Store Output into '$(vOutputfilename)' (txt);
Hi,
As @lironbaram suggested you can concatenate extra line at end of output data.
Enhancing @lironbaram solution
Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price
resident Temp;
concatenate
Load 'EOF' as "Product Code"
Resident Temp;
Let vOutputfilename=Replace('Catalogue $(vContract) '&today()&'.csv','/','-');
Store Output into '$(vOutputfilename)' (txt);
Hi
what is the content of the new line
if the line should be part of the file you can use something like
Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price
resident Temp;
concatenate (Output)
load 'A' as something
autogenerate 1;
the new line I need to add on output is EOF as per below screensshot
Product code | Customer | Agreement code | Description | Unit of measure | Pack size | Pack size description | Variable weight | Base VAT code | Category | Contracted Price | From date | Price |
23 | NOR | *ALL | xxxx | PK | 20 | 20x125g | FALSE | Zero | Box | Y | 09/10/2018 | 9.99 |
126 | NOR | *ALL | xxxx | PK | 6 | 6x2.6kg | FALSE | Zero | Tin | Y | 17/10/2018 | 10.99 |
EOF |
Hi,
As @lironbaram suggested you can concatenate extra line at end of output data.
Enhancing @lironbaram solution
Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price
resident Temp;
concatenate
Load 'EOF' as "Product Code"
Resident Temp;
Let vOutputfilename=Replace('Catalogue $(vContract) '&today()&'.csv','/','-');
Store Output into '$(vOutputfilename)' (txt);