Help with data collection please?


 
Thread Tools Search this Thread
Operating Systems AIX Help with data collection please?
# 1  
Old 11-12-2008
Help with data collection please?

Hello,

I have about 200 different files that I need to get data from. Can someone help with a script that will:

1. Find the files
2. Parse the file for a specific number
3. collect a number to a file (probably)
4. add up the numbers
5. spit out the total.

Think it's possible?

BTW - It's a AIX 5.2 OS.
# 2  
Old 11-12-2008
Question Really need more info

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.
# 3  
Old 11-13-2008
Thanks. I think I was over complicating it. What I did was:

1. grep all the files for a particular line
2. sent the output to a text file
3. imported the text file to excel
4. calculated the numbers
# 4  
Old 11-13-2008
Hammer & Screwdriver grep to an awk might have done this

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.
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Some % of Garbage Collection

I need to write a python script that will look at the local gc logs. 6 sys=0.00, real=0.06 secs] 2019-06-05T07:43:12.029-0500: 1072696.494: 2791209K->1995953K(2796544K)] 2803355K->1995953K(4164608K), , 3.0299555 secs] 2019-06-05T07:43:17.149-0500: 1072701.614: 3334321K->2008193K(4167680K),... (1 Reply)
Discussion started by: xgringo
1 Replies

2. UNIX for Dummies Questions & Answers

Collection of Unix Links

Hi, Is there is a good collection of Links to Unix Related stuff? Regards, Kriss (1 Reply)
Discussion started by: Kriss
1 Replies
Login or Register to Ask a Question