
06-23-2009
|
|
Registered User
|
|
|
Join Date: Apr 2009
Posts: 523
|
|
Quote:
Originally Posted by pa.chidhambaram
...
You can use the below command to delete the invalid line.
cat data | awk '{ if(substr($1,1,5)!="" && substr($1,6,10)!="" && substr($1,11,12)!="") print $1}' > new_filtered_file_name.
Where the data is the input file.
...
|
Really ?
Code:
$
$ cat data
DINESKUMAR21
SACHISHAH 23
23
GURUNTARIM22
$
$ cat data | awk '{ if(substr($1,1,5)!="" && substr($1,6,10)!="" && substr($1,11,12)!="") print $1}'
DINESKUMAR21
GURUNTARIM22
$
$
tyler_durden
|