Need script help.

Jeffrey McCright jmccright at hotmail.com
Thu Jun 21 16:42:02 CDT 2007



Thanks, Monty! I will pass it along.


Jeffrey A. McCright, A+
816-210-3107
jmccright at hotmail.com





>From: "Monty J. Harder" <mjharder at gmail.com>
>To: "Jeffrey McCright" <jmccright at hotmail.com>
>CC: kclug at kclug.org
>Subject: Re: Need script help.
>Date: Thu, 21 Jun 2007 11:24:55 -0500

>
>On 6/21/07, Jeffrey McCright <jmccright at hotmail.com> wrote:
>>
>>All,
>>
>>I have a friend who needs to run a shell script to process data in a space
>>or comma delimited file. I think SED or AWK may be needed here, but I
>>don't
>>program so I need help. The ASCII File structure is similar to the
>>following:
>>
>>Lastname Firstname internalphonenumber externalphonenumber phoneextention
>>MACaddress ...
>
>
>
>
>{command} Lastname {command} Firstname {command} internalphonenumber
>>{command} externalphonenumber ...
>
>
>
>It's not clear whether you want to produce a new file interpolating some
>command(s) with these values or what, exactly
>
>cat asciifile | while read LName FName IntPhn ExtPhn PhExt MAC Junk
>do
>  echo "{command} $LName {command} $FName {command} $IntPhn {command}
>$ExtPhn {command} $PhExt {command} $MAC"
>done >outputfile
>
>You may find the read metaphor easier than awk for this, because it's such 
>a
>PITA to get the extra quoted spaces in there.  You especially may find this
>works better if instead of just producing this output, you're actually
>needing to run some command(s)
>inside the while loop.
>
>Note the Junk at the end of the read statement.  It slurps up any extra
>words on the input line past the last variable name.  That way the
>MACvariable doesn't get junk in it.
>
>etc...
>>
>>The file contains around 1400 records or more. Each record needs to be
>>processed as above.
>>
>>Does this make sense? Any ideas?
>>

_________________________________________________________________
Hotmail to go? Get your Hotmail, news, sports and much more! 
http://mobile.msn.com



More information about the Kclug mailing list