skip statement not recognised in notepad

shafee212

Member
I am importing data from some table . and using skip command to goto next line .

output comes fine in wordpad application ......but in notepad it is not coming properly.

any soln for this .
 

StuartT

Member
It sounds very much to me that you are producing the file under a UNIX/linux environment then reading in windows.
Unix and windows handle carriage returns differently and Wordpad being a more modern editor than notepad can handle this whereas notepad cannot.
The only way to avoid this is to convert the file to dos format by the use of the following command
ux2dos <filename> > <newfilename>
 

RealHeavyDude

Well-Known Member
The line break is different on different OS. On *nix for example the line break is done solely with the line carriage return ( CHR(10) IIRC ). On Windows an additional character, line feed ( CHR(13) IIRC ) is used to constitute the line break. If that second character is missing then notepad will not display the line breaks correctly. But there are editors out there which are smarter and display the line break correct for you ... ( although I would not call Wordpad smart, but that's just IMHO ).

Did you produce the file on a *nix operating system? AFAIK, SKIP writes the line break characters to the file specific the current environment ...

The only solution - if you want the line breaks to be displayed correctly in notepad - is to make sure that both characters that constitute the line break on Windows are in the file.

Regards, RealHeavyDude.
 

RealHeavyDude

Well-Known Member
In most *nix flavors I know there is something like unix2dos and it's pendant dos2unix available which does fix the line breaks for files which are to be transferred to a Windows environment or which are coming from a Windows environment. You should consider using the unix2dos command after you've created the files if they will be used in Windows mostly.

HTH, RealHeavyDude.
 

shafee212

Member
ux2dos coomand ....is it alreday present in UNIX ?? whats the actual syntax of running it . (or we need to load this commad using some scripts)
 

RealHeavyDude

Well-Known Member
In almost *nix flavors I came in contact with the command was available. Can't tell you whether these are part of "standard" *nix or if the system administrator needs to set them up. Try man unix2dos and you'll see ...

unix2dos original-file-name converted-file-name


HTH, RealHeavyDude.
 

StuartT

Member
ux2dos coomand ....is it alreday present in UNIX ?? whats the actual syntax of running it . (or we need to load this commad using some scripts)

Did you not even bother to read the 1st reply to your problem where i gave you the answer an hour and a half ago (as fas as I know both ux2dos and unix2dos should exist if not try both as they work in the same manner)
 

tamhas

ProgressTalk.com Sponsor
For the record, it is the other way around. Unix is New Line = line feed = CHR(10) and Windows is Carriage Return/Line Feed, i.e., CHR(13) + CHR(10). You have the values right, but the names flipped.
 

Cringer

ProgressTalk.com Moderator
Staff member
Of course the easiest solution is to stop using notepad and use wordpad, or even something more powerful and useful... :)
 
Top