Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

How to read a two columns file

SOLVED
Go to Solution
Highlighted
Occasional Advisor

How to read a two columns file

Hi,

 

I need something like that:

Read a file having 2 columns and provide a specific compute on each column.

 

If I schematize the idea it could be like this.

 

For each line of the text file

 -> call a function with value in column one

 -> doing something else with the column two

....

 

Thanks in advance,

Den.

1 ACCEPTED SOLUTIONS
Honored Contributor Honored Contributor

Re: How to read a two columns file

 
3 REPLIES
Honored Contributor Honored Contributor

Re: How to read a two columns file

 
Acclaimed Contributor Acclaimed Contributor

Re: How to read a two columns file

[ Edited ]

Besides Steven's "while read", you can use awk's fields, $1 & $2.  Of course you could need to write your function in awk, possibly using system to invoke a script.

Occasional Advisor

Re: How to read a two columns file

Thank you!