![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX Desktop for Dummies Questions & Answers Questions regarding GNOME, KDE, CDE, Open Office, etc go here. All UNIX and Linux Newbies Welcome !! |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |
| file transposing | mskcc | Shell Programming and Scripting | 24 | 08-04-2005 08:23 AM |
| transposing letters | myscsa2004 | Shell Programming and Scripting | 4 | 05-12-2004 07:11 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
More than transposing!
Hi everyone,
I have a poblem like that: I have a file which includes data looks like: 0.65214 0.3597 1.0 0.65244 0.3502 1.0 0.65273 0.3553 1.0 0.65305 0.3544 1.0 0.65327 0.3505 1.0 0.65359 0.3516 1.0 0.65578 0.6464 1.0 0.65605 0.6453 1.0 0.65633 0.6437 1.0 0.65660 0.6488 1.0 0.65688 0.6435 1.0 0.65716 0.6432 1.0 ... ... I have to convert this data to: 0.65214 0.35971.00.65244 0.35021.00.65273 0.35531.00.65305 0.35441.00.65327 0.35051.0 0.65359 0.35161.00.65578 0.64641.00.65605 0.64531.00.65633 0.64371.00.65660 0.64881.0 ... ... Yes, there is no "space" between some values. As you see, five row must convert to one row in given format. I tried very much, but I could not get it. Any suggestions? Regards, B. |
| Forum Sponsor | ||
|
|
|
|||
|
Thanks.
It's very fast. But it gives the error: Code:
bulash@linux-sb6k:~/phoebe_data/TZ_Eri> awk ' { printf("%s", $0)
> if(NR%5 == 0) {printf("\n")}
> ' B.txt > A.dat
awk: cmd. line:3: if(NR%5 == 0) {printf("\n")}
awk: cmd. line:3: ^ unexpected newline or end of string
Best wishes, B. Last edited by bulash : 04-11-2008 at 01:43 PM. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|