8 Comments

Ben P Said,
May 14th, 2008 @2:07 pm  

sed -e ‘/^$/d’ example_file1 > example_file2

mygif
jmw1836 Said,
May 14th, 2008 @4:37 pm  

sed ‘/^$/d’ FILENAME

mygif
May 14th, 2008 @8:52 pm  

sed “/^$/d” example_file1 > example_file2

mygif
Anirudh Said,
May 14th, 2008 @10:31 pm  

Apart from an awk script to do the same, i prefer writing one line of bash to do the trick.

input: example_file_1
output: example_file_2

cat example_file_1|while read line;do if [ "$line" != "" ]; then echo "$line"; fi; done>example_file_w

mygif
May 15th, 2008 @7:47 am  

grep -Ev ‘^$’ example_file1 > example_file2

mygif
trajan Said,
May 15th, 2008 @9:39 am  

this should do it:

sed ‘/^$/d’ file1 > file2

mygif
Olivers Said,
May 15th, 2008 @11:37 am  

Hi the answer is:

sed ‘/^$/d’ example_file1 > example_file2

mygif
May 20th, 2008 @11:30 am  

using grep find all lines starting with caracthers “\<w” and redirect the results to example_file2.

grep ‘\ example_file2

mygif

Random Post

Leave Your Comments Below

Please Note: All comments will be hand modified by our authors so any unsuitable comments will be removed and you comments will be appreared after approved