Unix import of a DOS spreadsheet...

Bruce Easton bruce at stn.com
Wed Sep 8 09:29:59 PDT 2010


  Without getting nit-pickety about who expressed/quoted something 
poorly, let me clear up the error in the STN's Developer's Reference.  I 
believe that the syntax for using 10&13 together as an argument for one 
of the export flags is invalid.  I believe there was discussion about 
this here on the forum.  I tried it as the record delimiter long ago and 
found it to not work.  I've always formatted export files from *nix that 
are intended for Windows using one of the following methods:

1a.  For a one-time job - I just vi the file and add Ctrl-M's to the 
ends of the lines using an ed command within vi:

g:/$/s/$/[ctrl-M]/g

(where "[ctrl-M]" is obtained by doing a Ctrl-V, then Ctrl-M)
(then just save the file)

or

1b.  If you're sending the file to the Windows system with ftp, port the 
file in ascii mode to the Windows system - it should get the Ctrl-M's 
added to the line endings by whatever you are using to do the ftp.

2. For something that needs to be embedded in a program for regular usage:

use sed    (there have been examples of this here not that long ago I 
think - maybe someone can provide a good example - I have one somewhere 
- I just can't remember and I haven't had my Sudafed and only half my 
espresso yet today)

There are some applications that require another ctrl character to be at 
the end of csv files - I forget which char. - as an end of file marker.  
So if no one tells you about them, then they can cause a bit of grief 
until you realize that you have to add/strip that last char as part of a 
process.


Bruce


Bruce Easton
STN, Inc.






On 9/8/10 11:28 AM, Mike Schwartz wrote:
>> Reference filePro Developers Reference   4th edition page 369   secs
>> 25.09.04&  25.10.02
>>
>> Where Stuart mentioned n=10&13 was for a record separator when
>> "CREATING" a
>> file on a Unix system for use in Windows not for import.
>>
>> Richard
>       Maybe you have hit the nail on the head, and that the r=10&13 syntax
> only works when exporting a file, not importing a file, although the book
> doesn't make that distinction.
>
>       In 25.09.06, where you are looking at this n=10&13 syntax, I think
> Stuart meant to write:  \n=10&13.
>
>       I'll have to test this on an export command later, when I have the
> time.
>
>       I was reading just a little above that in 25.09.02 (Codes for record
> and field separators and delimiters) where it states "The decimal equivalent
> of any ASCII character may be used." He goes on to say, "If you wish 2
> characters, join them with an ampersand (&). They are not enclosed in quotes
> or parentheses - just stated numerically."  That paragraph doesn't
> explicitly mention that it works only on exporting and not for importing.
>
>       By using an xlate command, I completed the accounting file import that
> I was trying to use this syntax with, so I'm going to live with the issue
> for the time being...
>
>       I would add this 2-digit record delimiter idea to the filePro "wish
> list", if that still exists, but I'm sure Ken has much bigger fish to fry...
>
> Thanks!
>
> Mike Schwartz
>
>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>



More information about the Filepro-list mailing list