![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| paste each 10 lines of single column to several column | nica | Shell Programming and Scripting | 4 | 01-22-2009 04:18 AM |
| converting .txt to comma delimeted file | OSD | Shell Programming and Scripting | 1 | 09-16-2008 03:51 AM |
| Converting Binary decimal coded values to Ascii Values | gaur.deepti | UNIX for Advanced & Expert Users | 3 | 04-02-2008 12:33 PM |
| How to check Null values in a file column by column if columns are Not NULLs | Mandab | Shell Programming and Scripting | 7 | 03-15-2008 09:57 AM |
| Comma Seperated List of Values | brap45 | Shell Programming and Scripting | 9 | 02-23-2006 05:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Converting Column values to comma delimted single Row
I have a requirement in which i have to read a file which has multiple columns seperated by a pipe "|" from this i have to read each column values seperately and create a comma seperated row for the column and write to another file.
eg: Input file: ColA ColB 1 2 2 x 3 y 4 c 5 q from this i have to create two filles, each having data as file_colA: 1,2,3,4,5 file_colB: 2,x,y,c,q i have created shell script using a for loop, which may take long time when i implement it in prod. can any one suggest an approach using awk or sed? thanks |
|
||||
|
Quote:
sorry for the wrong file Input file: ColA ColB 1|2 2|x 3|y 4|c 5|q and it doesnt have column header. thanks johnson for the approach, but it will try to read the file line by line, which i want to avoid. since in production i may have millions of records and this may cause a bottleneck. |
|
||||
|
i have single column which is starting with same string(many number of rows)
i have to convert each into a single row.how can i do that? laknar std mes 23 55 laknar isd phone no address amount 99 I have to convert above like below. laknar|std|mes|23|55 laknar|isd|phone no|address|amount|99 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|