Carriage Return Line Feed

brianp

New Member
Ive checked this forum and the bits I found dont seem to work.
I am creating a flat file and need either a CR or LF line/record terminator. I am trying
put stream abc
data1 ","
data2 ","
data3 ","
..... skip.
I replaced skip with "~n" then tried chr(10) then chr(13).
I loaded this to notepad to see how it looks and its not doing a CR or LF on each record. Any thoughts appreciated.
:confused:
 

brianp

New Member
Sorry forgot to add. No unformatted does not work. tried it with and without. Driven me nuts. Thanx
 

Casper

ProgressTalk.com Moderator
Staff member
You mean if you do:
Code:
define stream abc.
define variable iTmp as integer no-undo.
output stream abc to c:\temp\out.txt.
repeat iTmp = 1 to 10:
    put stream abc unformatted
        "AAA" ","
        "AAA" ","
        "AAA" ","
        "AAA" ","
        skip.
end.    
output stream abc close.

you see only one line of data? (and not 10 as it is supposed too?)

You are on windows?

Casper.
 

mobrien

New Member
When I run the following I get a new line for each record.

OUTPUT TO "Z:\Test.d".

FOR EACH contract NO-LOCK:

PUT UNFORMATTED contract.con-code + "," + contract.con-desc SKIP.

END.

OUTPUT CLOSE.
 

brianp

New Member
Yes I need to see 10 lines.
I am running the program on unix and the data is going into an Oracle DB (hyperion is the application) and I need LF or CF as record terminators.
If I load it into Notpad on Windows (which I am told is the way to check it) I get 1 record not many although you can see an unprintable character between each record.
If I cut and paste it as follows, it DOES show it in multiple as you can see.
aaaa,bbb
2cccc,dd
4cccc,ddddd,5cccc,ddddd,
6cccc,ddddd,
7cccc,ddddd,

In notpad I get where " is the unprintable character
aaaa,bbb"2cccc,dd"4cccc,ddddd,5cccc,ddddd,"6cccc,ddddd,"7cccc,ddddd,
 

ttpicasso

New Member
You could also use MS Word special characters to replace the quotes with a Carriage Return, not ideal but would solve your issue.
 

brianp

New Member
Thnx for all your help. None of the options work if I need to look at it through NOTEPAD as this is the option I've been told to check it with. NOT Wordpad.
Anyway I have used UNIX2DOS as there doen't seem to be any other alternative, and that works. Even the Progress link is what I have already tried and is fine for standard SKIP options.
 

Casper

ProgressTalk.com Moderator
Staff member
I think you didn't understand my answer.
Notepad is a windows application and expects CR + LF for a new line. While you make the file under Unix and therefore you get a LF.
IF you check with notepad then you see that as a square. In the original question you said you needed a CR or LF. Well, skip gives you a line Feed, but that shows up differently then you expect. Copy and past the square into the ASC function and you will see that it is a CHR(10).
IMO it is silly to be told to check this with notepad.

Casper.
 
Top