logfile extract to text

hello,
here a code to extract log file to text file
*********
ftp_get($ftp_link[$x],"./logs/$logs[$y]-$servers[$x].txt","/usr/monitoring/$logs[$y].log", FTP_ASCII);
$file[$x][$y] = file("./logs/$logs[$y]-$servers[$x].txt");
*************
but the problem the text file add blank line between each line is there anyway to remove this lines or to extract only text without blanks
Thanks for your help

vi chk_df.log
/dev/sda2              2585332     51952   2402052   3% /home
/dev/sda3               194449     10823    173586   6% /boot
/dev/sda5             10072456   2927076   6633712  31% /usr
/dev/sda7              2063504   1004720    953964  52% /
/dev/sda8              1035660     33052    950000   4% /tmp

text file

/dev/sda2              2585332     51952   2402052   3% /home

/dev/sda3               194449     10823    173586   6% /boot

/dev/sda5             10072456   2927072   6633716  31% /usr

/dev/sda7              2063504   1004720    953964  52% /

/dev/sda8              1035660     33024    950028   4% /tmp
usmbayAsked:
Who is Participating?
 
jonathanmelnickConnect With a Mentor Commented:
I believe your LF (unix) returns are for some reason getting converted to CRLF (Dos)...

Try using FTP_BINARY instead of FTP_ASCII, so that would now read :


ftp_get($ftp_link[$x],"./logs/$logs[$y]-$servers[$x].txt","/usr/monitoring/$logs[$y].log", FTP_BINARY);
$file[$x][$y] = file("./logs/$logs[$y]-$servers[$x].txt");
0
 
usmbayAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.