![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| replacing multiple lines with single line | siba.s.nayak | Shell Programming and Scripting | 3 | 05-28-2008 03:43 AM |
| Single column to multiple columns in awk | astroDave | Shell Programming and Scripting | 2 | 03-27-2008 10:00 PM |
| single column to multiple columns | agibbs | UNIX for Dummies Questions & Answers | 7 | 12-05-2007 10:04 PM |
| Reading multiple lines as single | braindrain | Shell Programming and Scripting | 9 | 10-18-2006 11:16 AM |
| Splitting a single line into multiple lines | thanuman | Shell Programming and Scripting | 4 | 02-23-2005 04:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Awk multiple lines with 3rd column onto a single line?
I have a H U G E file with over 1million entries in it.
Looks something like this: USER0001|DEVICE001|VAR1 USER0001|DEVICE001|VAR2 USER0001|DEVICE001|VAR3 USER0001|DEVICE001|VAR4 USER0001|DEVICE001|VAR5 USER0001|DEVICE001|VAR6 USER0001|DEVICE002|VAR1 USER0001|DEVICE002|VAR2 USER0001|DEVICE002|VAR3 USER0001|DEVICE002|VAR4 USER0001|DEVICE002|VAR5 USER0002|DEVICE003|VAR1 USER0002|DEVICE003|VAR2 USER0002|DEVICE003|VAR3 USER0002|DEVICE003|VAR4 USER0002|DEVICE003|VAR5 USER0002|DEVICE004|VAR1 USER0002|DEVICE004|VAR2 USER0002|DEVICE004|VAR3 USER0002|DEVICE004|VAR4 USER0002|DEVICE004|VAR5 USER0003|DEVICE005|VAR1 USER0003|DEVICE005|VAR2 USER0003|DEVICE005|VAR3 USER0003|DEVICE005|VAR4 USER0003|DEVICE005|VAR5 USER0003|DEVICE005|VAR6 USER0003|DEVICE006|VAR1 USER0003|DEVICE006|VAR2 USER0003|DEVICE006|VAR6 I would like a way to output only the uniq veriables onto a single line like so: USER0001|DEVICE001|VAR1|VAR2|VAR3|VAR4|VAR5|VAR6 USER0001|DEVICE002|VAR1|VAR2|VAR3|VAR4|VAR5 USER0002|DEVICE003|VAR1|VAR2|VAR3|VAR4|VAR5 USER0002|DEVICE004|VAR1|VAR2|VAR3|VAR4|VAR5 USER0003|DEVICE005|VAR1|VAR2|VAR3|VAR4|VAR5|VAR6 USER0003|DEVICE006|VAR1|VAR2|VAR6 Is this doable with awk or do I need to use perl array? Last edited by SoMoney; 12-04-2008 at 06:39 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|