Operating System - HP-UX
1830930 Members
2333 Online
110017 Solutions
New Discussion

Unix to Window, end of line broken, follow up

 
SOLVED
Go to solution
vikmos
Occasional Contributor

Unix to Window, end of line broken, follow up

I???ve posted a message regarding problems with files being xmitted between MVS=UNIX=Windows, where the end of line got broken if to see it in Windows.
I did try all recommended option with FTP but it wasn???t the solution.
The problem I think is different values for end-of-line in Unix = <\n> and
In Windows <\r\n>. so now I probably should just change it in Unix before sending it thru email.
Thanks to all

Vittorio
8 REPLIES 8
Brian Bergstrand
Honored Contributor

Re: Unix to Window, end of line broken, follow up

Did your try ux2dos to convert the file from unix line endings to windows (or dos2ux if you need the reverse)? These should be available on any UX system.
doug mielke
Respected Contributor

Re: Unix to Window, end of line broken, follow up

and some unix versions had the reverse, a 'dtox' command for 'dos to unix'
I always thought that was a great name for a tool to help getting MSoft files into a unix system
Tim Sanko
Trusted Contributor

Re: Unix to Window, end of line broken, follow up

Poisonous to any "Real" system...
vikmos
Occasional Contributor

Re: Unix to Window, end of line broken, follow up

Hi, tryied all, ux2dos and something like:
$ sed 's/[\n]$/\r\n/g' file1.txt.

Doens't work, I still see my file in NotePad or Excel/Word broken. This file was originated from MVS, then FTPed to UNIX. On UNIX it looks just fine, all lines are in their proper place.
Don't think that Bin or other option with FTP will help, as on UNIX file is OK.

Thanks
Vitt
Rahul Mehta
Valued Contributor

Re: Unix to Window, end of line broken, follow up

Bin will definately help..
that will solve the issue..

Brian Bergstrand
Honored Contributor

Re: Unix to Window, end of line broken, follow up

Are you trying to use this file over a NFS or Samba mount? If that is the case, then you need to convert the file to Windows line endings on the server.

ux2dos original_file > converted_file

Then you can open "converted_file" on your Win box.

The other thing is to make sure the file you are getting from MVS is ASCII and not EBCDIC (sp?) encoding. Not sure if MVS is still using EBCDIC.

Finally, WinWord on windows can open ASCII files with win/dos or Unix line endings and so can WinVI <>
vikmos
Occasional Contributor

Re: Unix to Window, end of line broken, follow up

Just tried FTP with , can't read file on UNIX (thru Putty),have :

????@@@??????????????????????????????????????????????????????????????a????a??????????@
vs
06/30/03ALEXXX== THIS IS REPORT 1111111111 (on MVS). Same thing I have transeferring this file thru email, either with Notepad or Word: just .
I have HP-11.00. Will keep trying.
Thanks to all respndents.

Vitt
Brian Bergstrand
Honored Contributor
Solution

Re: Unix to Window, end of line broken, follow up

This really sounds like an EBCDIC(sp?) vs. ASCII encoding issue. The garbled text is a dead give away. You need to convert the file to ASCII on MVS or find a way to do it on the UNIX/Windows side. I've never had to deal with this on the Unix side, but I'm sure there are some tools out there.