MkIII_Supra
05-17-2007, 06:58 PM
Okay, here is the deal. I have tried the 3 following methods to remove blank lines from .csv files that I have (205 of these files).
Grep first:
grep -v '^$' Meter\ History\ 61.csv > Meter\ History\ 61A.csv
Sed second:
sed '/^$/d' Meter\ History\ 61.csv > Meter\ History\ 61A.csv
Cat third:
cat -s Meter\ History\ 61.csv | tr -d "\f" | lpr
None of these worked. So I opened one of the files up in KHexEdit to see what gives. The "blank lines" show up as 4 dots with a value of 0d 0a 0d 0a.
The KHexEdit settings are stream length Fixed 8 bit. The four dots show in the editor show up as a blank line in OpenOffice AND Kate. I already have a bash script to cat these all together, but I have to figure out how the heck to get rid of the doggone blank lines, without opening each file up individually.
Attached is a sample file, change the extension to .csv, since I can't upload a .csv here I had to change it to a .txt. I am stumped (again).
Thank you,
Grep first:
grep -v '^$' Meter\ History\ 61.csv > Meter\ History\ 61A.csv
Sed second:
sed '/^$/d' Meter\ History\ 61.csv > Meter\ History\ 61A.csv
Cat third:
cat -s Meter\ History\ 61.csv | tr -d "\f" | lpr
None of these worked. So I opened one of the files up in KHexEdit to see what gives. The "blank lines" show up as 4 dots with a value of 0d 0a 0d 0a.
The KHexEdit settings are stream length Fixed 8 bit. The four dots show in the editor show up as a blank line in OpenOffice AND Kate. I already have a bash script to cat these all together, but I have to figure out how the heck to get rid of the doggone blank lines, without opening each file up individually.
Attached is a sample file, change the extension to .csv, since I can't upload a .csv here I had to change it to a .txt. I am stumped (again).
Thank you,