Hello,
I have about 200 different files that I need to get data from. Can someone help with a script that will:
Find the files
Parse the file for a specific number
collect a number to a file (probably)
add up the numbers
spit out the total.
Think it's possible?
BTW - It's a AIX 5.2 OS.
joeyg
November 12, 2008, 12:22pm
2
In order to provide any insight, really need to see some examples of input data and the desired output.
Commands like ls, grep, sort, uniq, awk all come to mind to assist, but not enough info to begin any scripting.
Thanks. I think I was over complicating it. What I did was:
grep all the files for a particular line
sent the output to a text file
imported the text file to excel
calculated the numbers
joeyg
November 13, 2008, 8:00am
4
If you provided some examples, myself or someone else might have been able to show you (and everyone else - since that is the purpose of this Board) how you could solve.
grep "something" myfile > selected_file
awk 'commands here' selected_file
the 'commands here' would have
read through records
set counters for array elements
add totals for array elements
print out final result
That is what I was referring to in my previous post. It is always better to include current file samples and desired output.