1/13/2014

Grep

    grep smug files         {search files for lines with 'smug'}
    grep '^smug' files      {'smug' at the start of a line}
    grep 'smug$' files      {'smug' at the end of a line}
    grep '^smug$' files     {lines containing only 'smug'}
    grep '\^s' files        {lines starting with '^s', "\" escapes the ^}
    grep '[Ss]mug' files    {search for 'Smug' or 'smug'}
    grep 'B[oO][bB]' files  {search for BOB, Bob, BOb or BoB }
    grep '^$' files         {search for blank lines}
    grep '[0-9][0-9]' file  {search for pairs of numeric digits}


http://www.robelle.com/smugbook/regexpr4.txt

1/08/2014

Nominal Fold

Nominal Fold = geophone spacing * no. geophones / 2 * shot spacing

Nominal Fold = streamer length / 2 * shot spacing


1/06/2014

Putting Two Consecutive Lines into One Line with Perl / AWK

I have a data like below:
abcd
join abcd
efgh
join efgh
I want to join the two consecutive pair into one line. Resulting:
abcd join abcd
efgh join efgh

$ sed 'N;s/\n/ /' tst.list 
abcd join abcd
efgh join efgh

http://stackoverflow.com/questions/10220348/putting-two-consecutive-lines-into-one-line-with-perl-awk