The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
combining fields in two text fields shocker Shell Programming and Scripting 3 01-16-2008 11:27 AM
cut: get either one or two fields maxvirrozeito Shell Programming and Scripting 3 12-17-2007 11:58 AM
Cut Last 3 Fields bourne Shell Programming and Scripting 4 01-11-2007 05:17 AM
Last fields Khoomfire UNIX for Advanced & Expert Users 3 04-13-2006 06:03 PM
how to cut fields rajan_ka1 Shell Programming and Scripting 1 12-29-2005 05:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-23-2001
DaveM DaveM is offline
Registered User
  
 

Join Date: Jan 2001
Location: UK
Posts: 2
Unhappy

Just written a great little script that analyses a flat ASCII CSV file and reports for any discrepancies with field counts per record etc.

Works fine on all the flat files except one, which has 113 fields per line. AWK can only seemingly cope with up to 99 fields.

Is there any way around this? It will be a pain to check manually as there are more than 100,000 records in this file!

Cheers

Dave
  #2 (permalink)  
Old 01-23-2001
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Probably depends which version of awk you are using. The version distributed with HP-UX supports up to 200
($0 .. $199). You might be able to do some subtraction using $NF if you cant access a field directly.

An alternative would be to use the 'cut' command or, even better, perl.
  #3 (permalink)  
Old 01-23-2001
DaveM DaveM is offline
Registered User
  
 

Join Date: Jan 2001
Location: UK
Posts: 2
Wink

Thanks for that! I eventually used :

cut -d, -f50- input_file > output_file

and then did my awk command on the output file, remembering to subtract 50 from any variable used thereon in.

Thats what I like about UNIX...there is a way around almost anything

Dave
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0