Archive

Posts Tagged ‘sed’

How to select odd (or even ) raws from a text file using the bash

January 27th, 2012 No comments

Yesterday I had to select some raws (1, 5, 9, ….) from a text file.

This has been a hard job because I was trying to solve the wrong problem……

Really, before coding you should analyze deeply your problem and then you should think which tool you need to use.

However, come on and see my experiments:

First of all we need a test file, I'll use the following:

dos2unix using sed – How to remove ^M chars from a DOS file

April 9th, 2009 No comments

After dos2unix using vim, here is dos2unix using sed


in bash you could type the following command:

Categories: Bash Tip & Tricks, linux Tags: , ,
Statistical data collected by Statpress SEOlution (blogcraft).