Export ASCII delimited with some padded fields

Michael Schwartz (PC Support & Services) filepromike at gmail.com
Thu Jun 6 11:34:32 PDT 2019


> export ascii file=(fn) f=*
> 
> (Note the requirement is to run all data on one long line, hence no r=\n)
> 
> I tried using named variables with a set length, using chr("32"), and
setting an
> edit using {*} \20\ and nothing worked.  It doesn't honor the spaces and
> butts the delimiter right up against the end of the data (or other
delimiter).
> I'm doing this for an 856 ASN EDI document.  The trading partner needs
fields
> 3 and 5 to have 10 blank spaces and fields 7 and 9 to be a 15 characters
(I only
> have 14 characters worth of data).  Those two fields should have a space
> between the end of the data and the delimiter.  The rest, however, should
> be delimited normally so I can't use fixed width.
> 
> Here's a sample of what I'm trying to do:
> ISA*00*          *00*          *12*1111111111TEST *12*2222222222TEST
> *190528*1447*U*00401*000001036*0*P*>~
> 
> Here's what it's doing:
> ISA*00**00**12*1111111111TEST*12*2222222222TEST*190528*1447*U*004
> 01*000001036*0*P*>~
> 
> Thanks,
> Josh

     Try playing with the "-X" option on the export command.  The -X option
maintains the length of the fields you are writing, including spaces.

     If that doesn't work for you, you will have to use "writeline", which
gives you complete control over what goes into the output file.  

Mike Schwartz




More information about the Filepro-list mailing list