Aimal Pashtoonmal wrote:
> 
> Hi,

Hello,

>   I am trying to get the following one liner to work, but the figure
> from the subtraction is printed after column 6 and column 7 and 8 are
> discarded. What I am trying to do is create an extra column
>   after column 6 for the subtraction and retain the last two columns:
> 
>   perl -F'\t' -lane 'print join("\t", @F[0..8], $F[6] - $F[5])' *
> 
>   input data:
>   68152     922949   639F        510     100   150        245   870
>   46735     985967   649A        600     90     110       344   915

When you say column 6 are you counting from one or zero?  Do you
actually have whitespace at the beginning of the input data or is that
an email formatting thing?

See if this works:

perl -lane'splice @F, 6, 0, $F[6] - $F[5]; print join "\t", @F' *



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to