Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete line 1

Status
Not open for further replies.

cbsm

Programmer
Oct 3, 2002
229
FR
hello,
I have a .csv file (created by 'users'). I need to load this file in a database.
I'd like to 'prepare' the file, to avoid any problem during the load.
This is why I need to delete every line where there is nothing else than ; or spaces.
Example

a;b;c;d
;;;
; ;
;
e;f;g;h

should become :
a;b;c;d
e;f;g;h


Thank you !

 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Basically, I do not know much about unix.
I usually use the sed command.
I know for example how to delete a line containing a pattern.
But this case is a bit different and I have no idea how to start.


 
what about this ?
sed -n '/[^ ;]/p'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top