Core iTOps Tube

Monday, 7 May 2012

Delete blank lines in a file

Hi All,



I have a file and I need to delete the lines that are blank and is starting with some characters below. Something like below:




Code:


Regular Ascii File:



Line1:  AGODA1        BUSAN||SK        Lord Beach        4/6/2012        4/7/2012        68060

Line2:  AGODA2        BUSAN||SK        Beach Hotel        4/6/2012        4/7/2012        610200

Line3:  Skahds4

Line4:  AMAN12        CHI        MMa        4/6/2012        4/7/2012        612134

Line5:  Depp

Line6:  ROGER|south|MMa1|4/6/2012|4/7/2012|53106

Line7:  Mango

And so on


I need to delete the lines that has character in the beginning but nothing after that. In my case, I need to delete lines 3, line 5 and line 7(which are shown in bold above).



I will really appreciate any advice.




No comments:

Post a Comment