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

How to read a two columns file

SOLVED
Go to Solution
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.

3 REPLIES
Highlighted
Honored Contributor [Founder]

Re: How to read a two columns file

 
Acclaimed Contributor [Founder]

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!