Hi all...

I have just started scripting in KShell and I have this code that extracts information out of a database under different fields. Now, if I further want to refine the data that is being extracted, say matching with a particular term under a particular field, can you please tell me how it can be done? I think a filter needs to be created... don't know how to write the script for it.

Thanks in advance

Recommended Answers

All 2 Replies

awk is what you want.

Assume your extract code runs like this: extract
and it prints data to stdout.

And assume you have columns of data and you want column #3 to be larger than 10.

extract | awk ' if($3 > 10) {print $0} ' >  resultfile

You should read up on awk. One of it's main jobs is filtering data.

hi...thanks a ton..
I'm able to proceed..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.