[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ReadLines and Substraction

From: pk
Subject: Re: ReadLines and Substraction
Date: Mon, 14 Mar 2011 11:08:39 +0000
User-agent: KNode/4.4.9

yetcom wrote:

> Hello Everyone,
> I have an issue regarding the bash. I have 2 different files and each
> of them involves some float point numbers for each lines. I want to
> subtract each line then put all the results into a file. The first
> line float number will be subtract with the first line of other file
> and the second with the other second... and etc...
> When I read both files with:
> cat ./Temp1.log | while read line; do
>             cat ./Temp2.log | while read line; do
>             #It reads the first line of temp1, I also need to read the
> first line of temp2. However, Temp2 will be read until the end of file
> so that I cannot read one by one for each lines of different files.
>             done
> done
> If you can help me with this, will be very happy for that. Thanks in
> advance.


paste -d '-' file1 file2 | bc > results

reply via email to

[Prev in Thread] Current Thread [Next in Thread]