![]() |
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 |
| Remove whitespaces between comma separated fields from file | nitinbjoshi | UNIX for Dummies Questions & Answers | 2 | 06-14-2008 09:14 AM |
| Parse a string in XML file using shell script | ayhanne | Shell Programming and Scripting | 46 | 01-09-2008 12:33 PM |
| search for the contents in many file and print that file using shell script | cdfd123 | Shell Programming and Scripting | 3 | 10-07-2007 11:17 PM |
| How to parse config variables from external file to shell script | pradsh | Shell Programming and Scripting | 2 | 07-09-2007 03:21 PM |
| Splitting comma separated values into an array | tmarikle | Shell Programming and Scripting | 3 | 06-24-2005 06:50 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Unix shell script to parse the contents of comma-separated file
Dear All,
I have a comma-separated file. 1. The first line of the file(header) should have 4 commas(5 fields). 2. The last line of the file should have 1 comma(2 fields). Pls help me in checking this condition in a shell script. And the number of lines between the first line and last line of the file, should match with the last field of the first and last line. That is, the last field of first and last line wil have a number, that should match with {number of line in the file} -2. Pls help me out with this. Example file: QDB_2008.txt 1.1,20070427151500,99567,99669,0009 00001,20070427,00567,6012345671,2081,I 00002,20070427,00568,6012345672,2054,I 00003,20070427,00569,6012345673,2063,I 00004,20070427,00570,6012345674,2081,D 00005,20070427,00571,6012345675,2054,D 00006,20070427,00572,6012345676,2063,D 00007,20070427,00573,6012345677,2081,U 00008,20070427,00574,6012345678,2054,U 00009,20070427,00575,6012345679,2063,U 101.1.0,0009# Regards, Krishna |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|