Linux, programming, computers and life

April 7, 2007

awk/sort/grep/sed and friends vs Ms Excel and OO Calc

Filed under: CLI, GUI, linux, awk

Recently i had a long text file (about 114K lines) which contained strictly formatted lines (output from some of our tools) which i wanted to sort by a certain columns.
While my first solution is usually command line based i thought “I will need a lot of different sorts - let’s do it in Excel - it’ll probably be faster over all”. So i went to my remote desktop, opened Excel and imported the file - which was very easy (i believe there’s File->Import and even File->Open worked). However there’s a limit of 64K lines in Excel - so i got less then 50% of the file. I didn’t give up. I remembered i have OO installed so i launched Calc and, after some time spent in menus browsing (well, there’s File->Export but no File->Import, i believe the solution was somewhere in Insert menu), i imported the file. Well. A surprise - OO also has line amount limitation.
I’m human after all, and i gave up. In order to find minimal and maximal values in 2nd column of the file i needed to do the following:

sort -un -k 2 MyFile | head -n 2
and
sort -unr -k 2 MyFile | head -n 2

Windows users will not even think of this solution…. And with sort, grep, awk and sed one can truly make wonders. Go read the man pages!

Technorati Tags: , , , , , , ,

Comments »

The URI to TrackBack this entry is: http://linux4all.blogsome.com/2007/04/07/awksortgrepsed-and-friends-vs-ms-excel-and-oo-calc/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers