![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| convert a pipe delimited file to a':" delimited file | priyanka3006 | Shell Programming and Scripting | 6 | 05-26-2009 11:53 AM |
| Convert comma text file to Column in html format | sriram003 | Shell Programming and Scripting | 9 | 03-31-2009 09:16 AM |
| Help needed to convert delimited to CSV format | karthikd214 | Shell Programming and Scripting | 5 | 02-05-2009 01:42 PM |
| how to convert the result of the select query to comma seperated data - urgent pls | Hemamalini | Shell Programming and Scripting | 1 | 06-16-2008 05:27 AM |
| Converting Tab delimited file to Comma delimited file in Unix | charan81 | Shell Programming and Scripting | 22 | 01-20-2006 09:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Urgent! need help! how to convert this file into comma delimited format
Hi experts,
I need urget help! I have the a text file with this format: Types of fruits Name of fruits 1,1 Farm_no,1 apple,1 pineapple,1 grapes,1 orange,1 banana,1 2,2--->this is the record seperator Farm_no,2 apple,1 pineapple,1 grapes,3 orange,2 banana,1 3,3--->this is the record seperator Farm_no,3 apple,4 pineapple,2 grapes,3 orange,2 banana,0 I need to parse this txt file into csv format. The output need to look like this: FARM_no,apple,pineapple,grapes,orange,banana 1,1,1,1,1,1 2,1,1,3,2,1 3,4,2,3,2,0 Anyone have any idea?Please help! Thank a lot! Thanks. |
|
|||||
|
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.
Please review the rules, which you agreed to when you registered, if you have not already done so. More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on. If you did post homework in the main forums, please review the guidelines for posting homework and repost. Thank You. The UNIX and Linux Forums. |
|
||||
|
Hi Zaxxon,
I have tried the above thread using awk but unsuccessful: #!/bin/bash echo "FARM_no,apple,pineapple,grapes,orange,banana' awk -F "," '{ print $2}' text file But I am not sure how to use the RS, since the record seperator is different and how to start form the 3rd line. Thanks |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|