in reply to Re: File size discrepancy
in thread File size discrepancy

Thanks for the insight! I used a simple FTP to download the file. The newlines idea makes sense, any thoughts for downloading files with Unix newlines rather than Windows newlines? I am grateful for your help!! Rick

Replies are listed 'Best First'.
Re^3: File size discrepancy
by Corion (Patriarch) on Nov 25, 2014 at 17:58 UTC
Re^3: File size discrepancy
by Laurent_R (Canon) on Nov 25, 2014 at 19:52 UTC
    FTP has 2 modes: ascii and bin. The bin mode transfers the file exactly as it is, the ascii (text) mode makes end-of-line conversions between Unix and Dos. Having said that, if you transfered it in ascii mode and want to get it back to Unix format, you don't need to download it again, you can just use this command:
    perl -pi.bak -e 's/\r//g' file
    to convert it back to Unix format. Or your system may very well have a dos2unix utility doing just the same. On the AIX system where I do most of my work, dos2unix did not not exist, so that I created an alias for it using the Perl one-liner above. On most Linux systems, however, I would think that dos2unix should exist.
      Thank you so much! That is very helpful! Really appreciate your insight!