TXT Unix To Dos

Post Reply
User avatar
miragerr
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

TXT Unix To Dos

Post by miragerr »

Hello friends,

I get a TXT file in UNIX format, how to open it to read the file in the DOS format by Fivewin, I tried with ttxtfile, more does not have the lines breaks

Is there any way to read the file?

I'll be waiting.
Jackson Douglas C. Brito
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: TXT Unix To Dos

Post by Jack »

Hi,
I think that unix use only chr(10) and not chr(13)+chr(10) .
Replace CHR(10) with CHR(13)+CHR(10) .

Try it,

Philippe
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TXT Unix To Dos

Post by cnavarro »

Use function hb_eol()
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
miragerr
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

Re: TXT Unix To Dos

Post by miragerr »

How ?

oFile := TTxtFile():New( cFileName ) << File is Unix Code or UTF-8 not BOM

Do While !oFile:Eof()
cLine := oFile:ReadLine() // << here is the problem
? cLine
oFile:Skip()
Enddo
Jackson Douglas C. Brito
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: TXT Unix To Dos

Post by nageswaragunupudi »

Code: Select all

cText    := MEMOREAD( cFile )
aLines   := HB_ATokens( cText, CHR(10) )
XBROWSER aLines
 
Regards

G. N. Rao.
Hyderabad, India
Post Reply