Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

invisible data in a file from Dos to Unix

Posted on 2001-07-27
6
Medium Priority
?
277 Views
Last Modified: 2010-04-21
I ftp from dos to unix, put from dos. I can see all the data in the dos file on dos side. But when I vi the file on the unix side the last line of data is missing. When I process the file with an import utility the data from the last line is imported.

How can I see the entire data file in Unix? What is causing the data to appear not to be there?

SCO
0
Comment
Question by:petro2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:gcauthon
ID: 6327980
It could be a terminal setting.  If the $TERM variable is set incorrectly, the last line of the screen may show strange data or nothing at all.  Try setting $TERM to something standard like vt100 and see if the problem persists.
0
 
LVL 11

Accepted Solution

by:
griessh earned 800 total points
ID: 6328000
I am not sure what you do to 'see' the data. The difference between UNIX and DOS text is the End Of Line character. If You have text files, it is always good to use a utility like unix2dos/dos2unix to convert the texts. UNIX uses a LF as End of Line, DOS uses CR/LF. Some editors can't handle both combinations. I would also make sure that there is a LF at the end of the last line.

As I said try to convert the DOS CR/LF combination with a LF before you ftp ...

BTW: CR means Carriage Return (char 0x0d) and LF means Line Feed (char 0x0a)

======
Werner
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6328037
Do you get a message from vi that looks something like 'Missing newline on last line of file'?  If so, that's your problem.  It doesn't mean the file is different on Unix and Win*, but merely that vi doesn't display the file properly.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Expert Comment

by:griessh
ID: 6328265
petro

Just wondering ... you accepted my suggestion, but the grade was C only. Any specific reason for that?

======
Werner
0
 

Author Comment

by:petro2
ID: 6328612
I hoping I would not have to use another utility on this problem, that it could be handled by just changing a parm, or a view that I was doing. Your suggestiong works, but it not the magic bullet I was hoping for. I have been poisoned by thinking that a command like:

cat -parm  filename  

would give me a view of the file quickly. I am taking this file off the Internet with a windows server, putting on the Unix box for one application coping it and letting an AS400 picked up the file a process it over there. When there is a problem with the file I always look at the unix box 1st to see what the file looks like. So if I can't just pop it open and get an answer then anything I do to the file makes my observation suspect.
Sorry maybe I took my disappointment out on you. Please forgive. I will go home tonight and do a penitence. thanks for your help. Have a nice weekend.
0
 

Expert Comment

by:gmancuso
ID: 6346895
here's a thought... when you ftp it, make sure you transport in ascii mode... this takes care of the translation of cr/lf and lf for you.

-G
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question