Record count in Unix servers

Hi All,

when i ftp the file from windows machine to unix server the record count in the file is decreased by 1.

example: Say a text file has three lines in it and when you place this file in unix server from your local machine and run a below command
cat filename | wc -l
the output is showing as 2

but when you create a same file and same lines in unix machine directly it will show record count a 3

Any idea why it so?

---------- Post updated at 07:23 PM ---------- Previous update was at 07:23 PM ----------

Record count of windows file in unix server

UNIX does not like windows carriage control bytes - ascii 10 and ascii 13. UNIX carriage control for text files is just a single ascii 10. Called a newline character.

If you want things to work the way you expect all windows files moved to UNIX have to be run through the dos2unix (sometimes called dos2ux) command.

... or do the ftp in ASCII mode (not BINARY mode).