babom
June 27, 2012, 9:47am
1
Hi All,
I need help for doing the following.
I have a input file like:
aaaaaaaaaabbbbbbbbbbbbbbbbbbbb
cccbbbbbaaaaaadddddaaaabbbbbbb
now I am trying to generate a output csv file where i will have for e.g.
0-3 chars of each line as the first column in the csv, 4-10 chars of the line as the second column of the csv.
What about rest of the characters 11-...? Should they be in 3rd column?
zaxxon
June 27, 2012, 10:45am
3
Something like
$ sed 's/^\(...\)\(.......\)/\1;\2;/g' infile
aaa;aaaaaaa;bbbbbbbbbbbbbbbbbbbb
ccc;bbbbbaa;aaaadddddaaaabbbbbbb
$ sed 's/^\(...\)\(.......\).*/\1;\2;/g' infile
aaa;aaaaaaa;
ccc;bbbbbaa;
?
1 Like
babom
June 27, 2012, 12:24pm
4
guys thanks for the replies...I think the first e.g. of sed will be helpful..................