5 Replies Latest reply: May 1, 2014 12:31 PM by Dwight Shackelford RSS

    Double quotes enclosing some records when exporting to a TXT file

      I'm trying to create a text file for import into another system.

      There is only one field being exported, one field per row, but some rows are enclosed in double quotes.  I need a clean export without this.

       

      Here is an example, that repeats for each HDR record:

       

      Rec_String

      |REC|1|100002-SM-AS|

      "|HDR|SM-AS|100002|IC-DRAM-MOD, DDR2, 1GB, 667MHZ, SODIMM|Component|Active|VMI|BUY|gw@sm.com|"

      |DET|NA|0|99.5|0|1000|1000|12||0||0|Active|Inactive||

       

      I'm assuming those double quotes are thrown in because of the commas in the text of that field.  This data is constructed in other queries to be exported here, and it is delimited by the "|" character, so I do not need the system to include the double quotes.

       

      How do I get rid of this?

       

      Also, how do I get rid of the field name at the top, "Rec_String"?

       

      Here is the store command I'm using:

       

       

      Store FD_AS into 'C:\Documents\FD_FD-SM-S02-' (txt); // + year(now()) + Month(now()) + Day(now()) + '1201353535' + '.txt'

       

      The stuff beyond the // is where I was trying to add a timestamp to the file name, but that is blowing up.  So, that would be a third question, how to concatenate those values onto the text.  I'm assuming using the Concat() function.  Not sure how to convert numeric to text right now, or if I have to.

      So, three questions:

      1) How to get rid of quotes?

      2) How to get rid of field name?

      3) How to concatenate the timestamp?

       

      The questions are in order of importance.

       

      Thank you.