Coding help with export

Mike Schwartz mschw at athenet.net
Thu Apr 12 18:46:09 PDT 2007


     Within your processing, you can always add chr("10")'s and chr("13")'s
yourself at the end of the line in any combination that you want.  Then you
don't have to worry about /R's and /N's or any extracurricular conversion
scripts.

 

Mike Schwartz

 

  _____  

From: filepro-list-bounces+mschw=athenet.net at lists.celestial.com
[mailto:filepro-list-bounces+mschw=athenet.net at lists.celestial.com] On
Behalf Of Del
Sent: Thursday, April 12, 2007 1:49 PM
To: filePro Mailing List
Subject: Coding help with export

 

Hi:

 

I feel dumb asking this, but I have wasted a lot of time already without a
solution, so maybe it is not as easy as I thought it should be, either that
or my brain is just not with it today (if so, not the first time).

 

Under SCO Unix, I am using the "export word" command to produce a flat ASCII
file.  Export word defaults to a record (or line) delimiter of \n (newline).
I want to change this to \r\n (carriage return/newline) for compatibility
with some windows software that the data is passed to.  Well, I have not
been able to find any way to do this with "export word" or even with "export
ascii" where I thought I could use r=\r\n, but this gives me a syntax error.

 

I even tried to issue a SED substitution command after generating the output
file:

 

sed s/\n/\r\n/ filename >target filename

sed s/"\n"/"\r\n"/ filename >target filename

 

I also tried:

 

tr "\n" "\r\n"  - this changed the \n to \r but not to \r\n.

 

None of this worked, I really don't know much about sed  or tr and regular
expressions, but thought this had a shot.

 

So is there any way to export an ASCII file and generate a record delimiter
of carriage return/linefeed? Or convert it after generating it with standard
Unix commands?

 

Del

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20070412/7c475e47/attachment-0001.html 


More information about the Filepro-list mailing list