AWK is a general purpose programming language that is designed for processing text-based data, either in files or data streams, and was created at Bell Labs in the 1970s

I noticed that Erik Wendelin wrote an article “awk is a beautiful tool.” In this article he said that it was best to introduce Awk with practical examples. I totally agree with Erik.

Eric Pement’s Awk one-liner collection consists of five sections:

  • 1. File spacing,
  • 2. Numbering and calculations,
  • 3. Text conversion and substitution,
  • 4. Selective printing of certain lines,
  • 5. Selective deleting of certain lines.

The first part of the article will explain the first two sections: “File spacing” and “Numbering and calculations.” The second part will explain “Text conversion and substitution”, and the last part “Selective printing/deleting of certain lines.” Continue reading »

  • Share/Bookmark

Too much work ? Slow servers ? Boss going crazy ?  Nothing working out ? Feel like killing someone ? ?

Continue reading »

  • Share/Bookmark

inspired from: codesqueeze.com

  1. Management has renamed its Waterfall process to Agile Waterfall
  2. You start hiring consultants so they can take the blame
  3. The Continuous Integration server has returned the error message “Fuck it, I give up”
  4. You have implemented your own Ruby framework that uses XML configuration files Continue reading »
  • Share/Bookmark

Ever wonder how to scroll upwards in mysl resultset ?

What if your terminal doesn’t allow scrollback or the scrollback buffer is somehow set to sreen lines ?

How to use MORE or LESS unix commands in mysql which would allow to scroll using ‘return’ or ‘spacebar’

Follow the steps given below:

[Invoke mysql using the --page command]

  1. mysql --page uuser -p  
  2. [set the pager to use less]

  3. mysql> pager less
  4. [run your query]

  5. mysql> select * from table_name

This also  works under the unix ‘screen’ terminal emulation

  • Share/Bookmark
© 2010 Think Lamp Suffusion WordPress theme by Sayontan Sinha