![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| More than transposing! | bulash | UNIX Desktop for Dummies Questions & Answers | 3 | 04-11-2008 02:20 PM |
| Transposing string | unibboy | Shell Programming and Scripting | 3 | 02-13-2008 02:12 PM |
| Major Awk problems (Searching, If statements, transposing etc.) | Blivo | Shell Programming and Scripting | 2 | 09-05-2007 03:41 AM |
| Another transposing issue | stevesmith | Shell Programming and Scripting | 14 | 09-16-2006 01:48 AM |
| transposing letters | myscsa2004 | Shell Programming and Scripting | 4 | 05-12-2004 07:11 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
file transposing
Hello,
Is there a way to transpose a file in shell scripting? For instance, from a1 a2 a3 a4 a5 a6 a7 .... b1 b2 b3 b4 b5 b6 b7 .... c1 c2 c3 c4 c5 c6 c7 .... d1 d2 d3 d4 d5 d6 d7 ... ... ... ... to a1 b1 c1 d1 .... a2 b2 c2 d2 .... a3 b3 c3 d3 .... a4 b3 c3 d4 .... ... ... ... Thanks in advance. |
| Forum Sponsor | ||
|
|
|
|||
|
Wired, My file is a multi-column based tab delimited file with uneven rows. It needs to be transposed to row based txt file. This is code,
bash-2.03$ more file_transpose ###file transpose, colume to row ###from unix.com/ygor, 07/29/2005 awk '{ for (f = 1; f <= NF; f++) a[NR, f] = $f } NF > nf { nf = NF } END { for (f = 1; f <= nf; f++) for (r = 1; r <= NR; r++) printf a[r, f] (r==NR ? RS : FS) }' atcc_fidler_pvs_all_markers.txt > atcc_fidler_pvs_all_markers_out.txt The error message is, sorgerlab-x% bash bash-2.03$ ./file_transpose awk: syntax error near line 3 awk: illegal statement near line 3 awk: syntax error near line 9 awk: illegal statement near line 9 Thanks for the help |