Export ASCII -x

Nancy Palmquist nlp at vss3.com
Thu Nov 18 11:04:14 PST 2010


Fellow filepro users,

I have twisted this around a few times and do not see what I am 
missing.  Windows - filepro v 5.0
fp Docs reads as follows:
*
*

*Structured ASCII (Fixed length ASCII)*

*       Then: EXPORT ASCII name -X*

*Creates an ASCII file called "name" in structured format.*

*This is a very useful export format. The entire field is placed in the 
export file. No field separators are required because each field takes 
up exactly its length in characters whether there is data in the field 
or not. The record delimiter is a new line by default. This format is 
becoming more and more of a standard means for exchanging files between 
systems and applications.*

It clearly says it should use a NEW LINE delimiter which should be CR/LF 
on windows.

Code looks like this:
330  -------   -   -   -   -   -   -   -   -   -   -
wrtxml ? If:
        Then: export ascii myxml=(expname{"") -x
331  -------   -   -   -   -   -   -   -   -   -   -
        ? If:
        Then: myxml(1)=myline{"" ;write myxml
332  -------   -   -   -   -   -   -   -   -   -   -


If myline contains just the data I want written, I get NO new line, I do 
not get 0d or 0d/0a appended

So I tried adding it to myline

myxml(1)=myline{chr("13"){chr("10")

Then I get at the end of each line: 0d 0a 0d  - It seems to want to add 
a 0d to my codes.

So I tried adding just chr("13") and then it added 0d 0a so I ended up 
with 0d 0d 0a

What wacky thing is going on?  Anyone got a suggestion.

Well I finally found what it needed.  So I guess this turned out to be a 
cautionary tale not a request for help after all.

330  -------   -   -   -   -   -   -   -   -   -   -
wrtxml ? If:
        Then: export ascii myxml=(expname{"") -x r=\n
331  -------   -   -   -   -   -   -   -   -   -   -
        ? If:
        Then: myxml(1)=myline{chr("10") ;write myxml
332  -------   -   -   -   -   -   -   -   -   -   -

This caused my file to end up with CR/LF (0d 0a) just what was 
required.  What weird logic is causing this but here it is if anyone 
else is looking for a solution.

Nancy

-- 
Nancy Palmquist         MOS&  filePro Training Available
Virtual Software Systems    Web Based Training and Consulting
PHONE: (412) 835-9417           Web site:  http://www.vss3.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20101118/a40e5fac/attachment.html 


More information about the Filepro-list mailing list