Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
sed: delete range of lines from a file (Read 2857 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
sed: delete range of lines from a file
18.03.10 at 08:44:16
 
sed: delete lines from a file
 
To delete lines from a file you can use the sed command.  
 
Remove a block of lines by line number:
The following command removes line 4245 untill the end of the file.
sed -i '4245,$d' test
 
Remove lines that match a pattern:
The following command removed all lines that contain the word GROUP from a file called test
sed -i '/GROUP/d' test
 
Remove empty lines:
sed '/^$/d' test
sed '/./!d' test
Back to top
 
« Last Edit: 24.04.10 at 09:10:05 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1