Unix import of a DOS spreadsheet...

Kenneth Brody kenbrody at spamcop.net
Sat Sep 4 11:09:20 PDT 2010


On 9/3/2010 8:45 PM, Mike Schwartz wrote:
> filePro 5.0.15K7R4 running on SUSE Linux 2.6.31
[...]
>       I was trying to import a spreadsheet that has lines that terminate in
> 0D 0A hex.  The Unix import function was reading in all the characters until
> it got to the last 0A on the line, so the 0D was ending up in the last field
> and messing up the screen drawing.
>
> I tried to rewrite the import as:
>
>     import ascii xcsv=(fn) r=13&10   f=, o=" c="
>
> However, I get a syntax error.  Is this still a supported way to set the
> end-of-record delimiter in 5.0.15?
>
>      Since /r designates the single character 0A in Unix, how else can I
> designate the 0A/0D combination on a Unix import line?

I'm not sure what you mean by "still a supported way", since the example you 
give was never valid.

Under Windows, where end-of-line is CR+LF, filePro's "\n" represents CR+LF. 
  However, on *nix, where end-of-line is LF, filePro's "\n" represents just 
LF.  If you have a Windows-formatted text file on *nix, then you'll need to 
eliminate the extra character somehow.  You could remove the CR from the 
last field with XLATE(field,chr("13"),"").

-- 
Kenneth Brody


More information about the Filepro-list mailing list