Operating System - HP-UX
1745804 Members
3883 Online
108722 Solutions
New Discussion

Re: How to read a two columns file

 
SOLVED
Go to solution
SwissKnife
Frequent 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 3
Steven Schweda
Honored Contributor
Solution

Re: How to read a two columns file

 
Dennis Handly
Acclaimed Contributor

Re: How to read a two columns file

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.

SwissKnife
Frequent Advisor

Re: How to read a two columns file

Thank you!