Hello,

You could try setting the file seperator to something not in a record
meaning the file is only one record long, therefore avoiding the overloading 
of fields, but this may make the field too large.
You can use gsub, does a global replace and tells you how many
replaces it did.  So if you replace , with a , and count how many
times you did it, and add 1
elegant or what

Sean
Tested it using gawk on a dos machine, so who know what will happen,
on a real machine.

BEGIN {
FS="@@@"
}
{
        x=gsub(",",",")
        ++x
        printf "%s,%s\n",x,$0
}


----Original Message Follows----
From: "Loupe, Rory" <[EMAIL PROTECTED]>
Reply-To: "Foxboro DCS Mail List" <[EMAIL PROTECTED]>
To: "'Foxboro DCS Mail List'" <[EMAIL PROTECTED]>
Subject: RE: awk, sed help
Date: Tue, 7 Mar 2000 12:45:42 -0500

I have figured out the command to do this in awk.  But I am getting a
"record .. has too many fields" error.  This is occurring when it processes
the parameters for the CALC block.  Is there a way in awk to increase the
maximum number of fields?

awk -F, '
    { print NF "," $0
    }' $FILE > HEADERS.TST

Thanks,
Rory Loupe



-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to [EMAIL PROTECTED] 
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]

Reply via email to