Results 1 to 4 of 4
hi all
i have a text like this
AAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90 AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 ...
- 10-17-2007 #1Linux Newbie
- Join Date
- Feb 2007
- Location
- hyderabad, india
- Posts
- 247
truncate help
hi all
i have a text like this
i wanna output like thisAAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90 AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90 BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90 AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
line by lineAAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90
AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90
BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90
AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
is there any script to do like this
please help me
thank you in advance"Relationships are built on trust and communication"
- 10-17-2007 #2Just Joined!
- Join Date
- Jul 2007
- Posts
- 41
Something like this should do it:
So if your text was in a file data.txt, you would use:Code:sed 's/ \([AB]\)/\n\1/g'
You may need to refine this to your actual data but this should work with the example you've given. It will find each occurence of a capital A or B following a space and swap this for the same character following a newline. This will not work if you actually have A/B in the rest of the output, this may work better:Code:cat data.txt | sed 's/ \([AB]\)/\n\1/g'
This will only replace it where there are 5 As and Bs in a row.Code:cat data.txt | sed 's/ \([AB]\{5\}\)/\n\1/g'
- 10-18-2007 #3Linux Newbie
- Join Date
- Feb 2007
- Location
- hyderabad, india
- Posts
- 247
hi all
i have a text like this
1). i would like to remove [5]....[234XXX] in this
2). and line by line
i wanna output like this[5]AAAAA [6]GGGGGG [7]25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90 [8]AAAAA [9]GGGGGG [10]29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90 [11]BBBBBB [12]GGGGGG [13]25OC200 [14]CE [15]5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90 [16]AAAAA [17]GGGGGG [18]27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
please help meAAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90
AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90
BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90
AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
thank you in advance"Relationships are built on trust and communication"
- 10-18-2007 #4Linux Newbie
- Join Date
- Feb 2007
- Location
- hyderabad, india
- Posts
- 247
hi all
i have a text file like this
i wanna output like thisAAAAA GGGGGG 25OC200 - - 5389.80 5203.10
5673.15 5255.00 89085 234115.83 5143.9
AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265
13869.14 5143.90
BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00
168.60 34.05 810 2281.01 5143.90
AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64
5143.90
please help meAAAAA GGGGGG 25OC200 - - 5389.80 5203.10 5673.15 5255.00 89085 234115.83 5143.90
AAAAA GGGGGG 29NO2007 - - 5389.00 5211.00 5674.00 5269.95 5265 13869.14 5143.90
BBBBBB GGGGGG 25OC200 CE 5600.00 74.00 15.00 168.60 34.05 810 2281.01 5143.90
AAAAA GGGGGG 27DE200 - - 5410.00 5125.00 5664.05 5265.00 694 1828.64 5143.90
thank you in advance"Relationships are built on trust and communication"


Reply With Quote