![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to delete empty lines | Aejaz | UNIX for Advanced & Expert Users | 5 | 04-30-2008 07:27 AM |
| regex to delete multiple blank lines in a file? | fedora | Shell Programming and Scripting | 6 | 10-11-2007 01:36 PM |
| using sed command to delete a string spanning multiple lines | radha.kalivar | Shell Programming and Scripting | 9 | 07-25-2007 07:26 AM |
| Need to delete multiple lines in a file. | kangdom | Shell Programming and Scripting | 6 | 10-16-2006 08:02 AM |
| Delete multiple lines w/ sed | bookoo | Shell Programming and Scripting | 2 | 07-25-2003 07:03 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
delete multiple empty lines
Hi,
I need to delete the lines with empty name. What is the best way to do it? Thanks a lot for your help! EMID MMDDYY HOURS JOB EMNAME 0241 051605 11.40 52062 someone 0520 051605 10.63 52062 0520 051605 10.66 52062 0520 051605 10.65 52062 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
awk '{ if(NF==5) {print $0 } }' filename > newfilename
|
|
#3
|
|||
|
|||
|
Quote:
Code:
awk 'NF==5' filename > newfilename |
|
#4
|
||||
|
||||
|
extra line in the file
Hi,
Thanks for the help. I used it and also got an extra line at the end of the file: [+pos1 [-pos2]] [-k field_start[type][,field_end[type]] [file...] ???? |
||||
| Google The UNIX and Linux Forums |