Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a script

Status
Not open for further replies.

sethu

Programmer
Apr 15, 2000
29
US
Hi,
I am vey new to awk. I need somebody either write or give a tip how to write a script. The script should do the following. It reads a text file which has entries like this

"val1" "val2"
"val3" "val4"

and so on....

the val1, val3 .... fields are positioned 1 to 32
the val2, val4 .... fields are positioned 33 to 259

I want to read val1 first and concatenate with some command and write to a file as first line

then the next line of the file will have another command concatenated with val2

then the next line of the file will have another command concatenated with val1 again

and so on ........... till the end of the file.

The output file will be like this

command val1 command
command val2 command
command val1 command
command val3 command
command val4 command
command val3 command

and so on .......

Can anybody help me?
 
sethu-

You need to tell us a bit more about the input data file such as:

What delimits the fields ( space, colon, comma)?

Does the file contain 2 fields per record as shown?

"val1" "val2"
"val3" "val4"

Additional information will help us help you.



flogrr
flogr@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top