Above code will work only if each field has only 2 characters, if any field has more than 2 characters then it will not help. Following may help in same just editing some points to your code.
Let's say we have input file as follows.
Output will be as follows.
Thanks,
R. Singh
---------- Post updated at 07:58 AM ---------- Previous update was at 07:38 AM ----------
Quote:
Originally Posted by Scrutinizer
All suggestions have a trailing TAB character, which introduces an extra field.
Like this there would be no trailing TAB:
or:
--
Except for the trailing tab this works fine, but only GNU sed understands \t...
Hello Scrutinizer,
Thank you for nice coode , if we have more than 2 characters in fields, then following may help.
hey guys...
Im looking to do the following:
1
2
3
4
5
6
7
8
9
Change to:
1 4 7
2 5 8
3 6 9
Did use | perl -lpe'$\=$.%3?$":"\n"' , but it doesnt give me the matrix i want. (3 Replies)
Greetings,
I have an input file with two columns. The first column has different codes. Each time I have a new code I need to split the columns into new ones. The input file looks like this
CR124 1320
CR124 1138
CR124 682
CR124 629
CR124 592
CR124 580
CR124 537
CR161 3967... (2 Replies)
Greetings,
I have an input file with two columns. The first column has different codes. Each time I have a new code I need to split the columns into new ones. The input file looks like this
CR124 1320
CR124 1138
CR124 682
CR124 629
CR124 592
CR124 580
CR124 537
CR161 3967
CR161 3656... (6 Replies)
So I have a space delimited file that I'd like to split into multiple files based on multiple column values.
This is what my data looks like
1bc9A02 1 10 1000 FTDLNLVQALRQFLWSFRLPGEAQKIDRMMEAFAQRYCQCNNGVFQSTDTCYVLSFAIIMLNTSLHNPNVKDKPTVERFIAMNRGINDGGDLPEELLRNLYESIKNEPFKIPELEHHHHHH
1ku1A02 1 10... (9 Replies)
Hey everyone,
I have an issue with a client that is passing me a list of values in one column, and occasionally the combination of all the values results in more than an 255 character string. My DB has a 255 character limit, so I am looking to take the column (comma delimited file), and if it... (1 Reply)
Hi,
I need help to split a long text in a column which is separated by ; and i need to print them out in multiple columns. My input file is tab-delimited and has 11 columns as below:-
aRg02004 21452 asdfwf 21452 21452 4.6e-29 5e-29 -1 3 50 ffg|GGD|9009 14101.10 High class -node. ; ffg|GGD|969... (3 Replies)
I have a big data set as follows
8.519 8.601 8.833 9.183 9.602
1.003 1.041 1.070 1.085 1.084
1.06 1.034 9.879 9.307 8.66
I simply want this to arrange like this
8.519 8.601 8.833
9.183 9.602 1.003
1.041 1.070 1.085
1.084 1.06 1.034
9.879 9.307 8.66 ... (2 Replies)
I have requirement to split below file (sample.csv) into multiple files by using the unique columns (first 3 are unique columns)
sample.csv
123|22|56789|ABCDEF|12AB34|2019-07-10|2019-07-10|443.3400|1|1
123|12|5679|BCDEFG|34CD56|2019-07-10|2019-07-10|896.7200|1|2... (3 Replies)