Dave Horner's Website - Yet another perspective on things...
Home Tech Talk Programming SED - stream editor
84 guests
Rough Hits : 2850746
moon and stars

More from me...

how did u find my site?





 
consciousness survives death of brain?



 
Equipped with his five senses, man explores the universe around him and calls the adventure Science.
--Edwin P. Hubble
\begin{bmatrix} 1 & 0 & \ldots & 0 \\ 0 & 1 & 0 & \vdots \\ \vdots & 0 & \ddots & 0\\ 0 & \ldots & 0 & 1_{n} \end{bmatrix}

SED - stream editor

Saturday, 14 January 2012 13:31
Sed - An Introduction and Tutorial by Bruce Barnett

Resuming from mid-way through an import from(Ben Nolan - Big MySql Imports)
cat dump.sql | sed -n -e '/`some_table_name`/,$p' | mysql --init-command="SET foreign_key_checks = 0;" database_name


To delete/skip the empty/blank lines: sed '/^$/d' inputFile
To delete/skip the lines that are empty or contain only spaces:sed '/^[[:space:]]*$/d' inputFile
To delete/skip the lines starts with #: sed '/^#/d' inputFile
To delete/skip the lines where the very first non-space character is #: sed '/^[[:space:]]*#/d' inputFile
Remove html tags: sed 's/<[^>]\+>//g'
command line - How to use sed to replace only the first occurrence in a file? - Stack Overflow

< Prev  Next >
Last Updated on Tuesday, 09 July 2013 21:22