Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am facing a problem with the export of the data in text file with the following script
EXPORT_TXT:
LOAD left(Store,4) & repeat(' ', 4-len(Store)) &
left(Item,10) & repeat(' ', 10-len(Item)) &
left(Item_Descr,35) & repeat(' ', 35-len(Item_Descr)) &
left(Qty,11) & repeat(' ', 11-len(Qty)) &
left(Sales,14) & repeat(' ', 14-len(Sales)) &
left(Price,14) & repeat(' ', 14-len(Price)) &
left(Barcode,14) & repeat(' ', 14-len(Barcode)) &
left(Secteur,3) & repeat(' ', 3-len(Secteur)) &
left(Rayon,4) & repeat(' ', 4-len(Rayon)) &
left(Family,4) & repeat(' ', 4-len(Family)) &
left(Subfamily,4) & repeat(' ', 4-len(Subfamily)) &
left(Ub,4) & repeat(' ', 4-len(Ub)) &
left(Ub,3) & repeat(' ', 3-len(Ub)) as Field
FROM C:\SALES_EXPORT.qvd (qvd);
Store EXPORT_TXT Into C:\Sales_Results.txt (txt, codepage is 1252, no labels, delimiter is '\t', no quotes);
in the text file in some lines appears the double quotes symbol "
how can i avoid this symbol and keep the grading of the file same, because i have to export the data in specific field length and the double quote destroys this grading
Thank you in advance.
Hello!
Before using some extract functions like Left() or Len() and so on, use Replace() function to remove unnecessary chars (in your instance it's a double quotes).
Like this:
Replace(Your_String,'"','')
P.S.:
You also may use functions Ord() and Chr() to remove some specific symbols.
What are you doing here
Store EXPORT_TXT Into C:\Sales_Results.txt (txt, codepage is 1252, no labels, delimiter is '\t', no quotes);
OR try this?
Store EXPORT_TXT Into C:\Sales_Results.txt
By seeing your code it seems you are looking for the data to be store in the TXT format, so for this, you don't convert the store expression into text format you have to do to this
Your store command:-
Store EXPORT_TXT Into C:\Sales_Results.csv (txt);
EXPORT_TXT:
LOAD
left(Store,4) & repeat(' ', 4-len(Store)) &
left(Item,10) & repeat(' ', 10-len(Item)) &
left(Item_Descr,35) & repeat(' ', 35-len(Item_Descr)) &
left(Qty,11) & repeat(' ', 11-len(Qty)) &
left(Sales,14) & repeat(' ', 14-len(Sales)) &
left(Price,14) & repeat(' ', 14-len(Price)) &
left(Barcode,14) & repeat(' ', 14-len(Barcode)) &
left(Secteur,3) & repeat(' ', 3-len(Secteur)) &
left(Rayon,4) & repeat(' ', 4-len(Rayon)) &
left(Family,4) & repeat(' ', 4-len(Family)) &
left(Subfamily,4) & repeat(' ', 4-len(Subfamily)) &
left(Ub,4) & repeat(' ', 4-len(Ub)) &
left(Ub,3) & repeat(' ', 3-len(Ub)) as Field
FROM C:\SALES_EXPORT.qvd (qvd);
Store EXPORT_TXT Into C:\Sales_Results.csv (txt);