You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
That means it is a Unix file. Unix files end with linefeeds (lf CHR$(10)), whereas DOS files end with a carriage return and a linefeed (crlf CHR$(13) CHR$(10)).
Typically people get Unix files through FTP and FTP can be set to do the conversion during the transfer by typing ASCII at the FTP> prompt. That is by far the easiest way to get the file so that it has crlf's.
It is kind of surprising that I wasn't able to find a conversion program in the PB forums, but maybe someone else can. What I used to do was to use a modified version of BUFIN.BAS. BUFIN.BAS can be found here: http://www.ethanwiner.com/WINER.ZIP
[This message has been edited by John Hackl (edited March 20, 2004).]
clean:
open "tmp" for output as #1
open file$ for binary as #2
while not eof(2)
get$ #2, 192, c$
a$ = a$ + c$
q$ = a$ : gosub cleanhead : a$ = q$
again:
p = instr(a$,chr$(10))
if p > 0 and p <= len(a$) then
q$ = left$(a$,p-1)
gosub cleanhead
gosub cleantail
if len(q$) > 0 then print #1, q$
a$ = mid$(a$,p+1, len(a$)-p)
goto again
end if
wend
close 2
close 1
shell "copy tmp "+file$+">nul
kill "tmp"
?"oke file "+file$+" cleaned
What I meant (with typo corrected on $LF) was, a using program could SHELL the LF2CRLF program without knowing or caring how it's delimited: because what comes back is <U>always</U> CRLF-delimited.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment