![]() |
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 |
| how to get a file name & record count of csv file | sirik | UNIX for Dummies Questions & Answers | 2 | 03-06-2008 02:55 PM |
| How count number of fields in a record | sureshg_sampat | Shell Programming and Scripting | 5 | 01-07-2008 06:30 AM |
| record count | dr46014 | Shell Programming and Scripting | 4 | 12-11-2007 04:39 PM |
| Need help with Isql record count | johnu122 | Shell Programming and Scripting | 4 | 11-18-2006 12:31 PM |
| How to count the record count in an EBCDIC file. | oracle8 | UNIX for Dummies Questions & Answers | 1 | 07-26-2006 07:22 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hello Gurus,
We have a requirement to count the valid number of records in a comma delimited file with double quotes. The catch here is..few records have a new line carriage within the double quotes,,say for ex:we have a file called accounts the record count is 4827..but the actual valid count is 4823..1 header row and 1 field in a record has 3 lines of data. So i'm having a tough time to count the exact count..we need to compare this count to the table count where we are loading this file to. Please suggest.. Thanks AJ |
|
||||
|
Quote:
Thanks Joey.. cat sample | tr "\n" " " | tr '"' "\n" | wc -l..seems to be working.. when I tried..found an issue..for one of the record the data has multiple double quotes ..("xyz","abc","toys ""R"" us", "def", "hij","....).. coz of this I'm not getting a round value count..how do I handle this? |
|
|||||
|
Quotes inside quoted field - yech.
Can you count comma's then, using similar logic to my 3rd option? Or, are there comma's inside the quotes also? That is quite possible. Perhaps try the first or second options? The 2nd will show how many lines begin with a " character - in theory, your continued lines would not begin with a quote character. Beyond the counting... good luck trying to decipher the file! |
|
||||
|
Quote:
|
| Sponsored Links | ||
|
|