Export file and the use of Append -a

Brian K. White brian at aljex.com
Tue Oct 19 21:57:24 PDT 2004


Bob Stockler wrote:
> On Mon, Oct 18, 2004 at 10:44:25PM -0400, John Esak wrote:
>>
>> This was a little confusing to me, too. He mentioned "fixed-length"
>> (which is -X as far as I know) and then he mentioned earlier that
>> you said he could not use -X with -a. (why?)  And wouldn't the -X
>> give him the record ending all by itself (no need for th chr("10")
>> thing?  I'm still confused... and I thought I _kenw_ this stuff. :-)
>
> Until 5.0.14 EXPORT ASCII did not support -X and -A on
> the same command line.  Whichever of -X or -A came first
> on the line would be observed, the other ignored.
>
> The work-around before 5.0.14 was to build an export line
> by hand if you wanted to use -A.
>
> That meant having to use & to join fixed-length fields (real
> or dummy) to build a line to be exported, terminated with:
>
>  & chr("10")
>
> so they ended with a newline character.
>
> More clear now?
>
> Bob

Rather, I beleive if you are using -X, but want newlines between records, 
that is the only time you need to put them in the data yourself as you 
describe.

If you are not using -X, then you can use r=\n on the export command.

It also works of course to omit the r=\n and put them in the data yourself, 
just, when juggling the multiple ways of doing the same thing, don't lose 
track and put them in the data AND have r=\n or you'll get 2 per line and 
it's not always obvious when that happens. some (dos/win) editors will not 
show the extra line, the recipient doing the import may sucessfully skip 
blank lines and get the whole file instead of getting just the first record, 
but you still want to avoid it.

In his case, even now that -A and -X are not mutually incompatible, I 
beleive he'd still need to continue putting the chr("10") in the data even 
if he switches to using  -A -X and stops building one big export field with 
&'s.
ie: he'd need to add one more field after the last field of the export that 
goes  out(26)=chr("10")

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani



Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani



More information about the Filepro-list mailing list