Search Results

Search: Posts Made By: exsonic
1,303
Posted By Yoda
awk ' BEGIN { i = 0 while (...
awk '
BEGIN {
i = 0
while ( i <= 61000 )
{
print i, 0
i += 50
}
} '
1,303
Posted By Corona688
I suggest a slight change: awk ' BEGIN { ...
I suggest a slight change:

awk '
BEGIN {
i = 0
while ( i <= 61000 )
{
print i, 0
i += 50
}
} ' /dev/null ...so it doesn't...
1,303
Posted By Yoda
Corona688, that is not necessary since the action...
Corona688, that is not necessary since the action is inside the BEGIN rule.
1,303
Posted By Corona688
You are right. I thought awk would still try to...
You are right. I thought awk would still try to read stdin, but apparently it does not when there is a BEGIN section and no other section. Interesting.
1,303
Posted By hanson44
seq 0 50 61000 | sed 's/$/ 0/'
seq 0 50 61000 | sed 's/$/ 0/'
3,372
Posted By Scrutinizer
Slight variation: awk '{split($0,A); getline<f;...
Slight variation:
awk '{split($0,A); getline<f; print A[1], A[2]-$2, A[5]-$3}' f=fileB fileA
3,372
Posted By drl
Hi. Similar to awk, Gary Perlman's |stat dm:...
Hi.

Similar to awk, Gary Perlman's |stat dm:
#!/usr/bin/env bash

# @(#) s1 Demonstrate column content arithmetic, |stat dm.
# See: http://hcibib.org/perlman/stat/index.html

# Utility...
3,372
Posted By Yoda
Using paste & awk:- paste file_A file_B | awk '...
Using paste & awk:-
paste file_A file_B | awk ' { printf "%d %d %d\n", $1, ($2-$7), ($5-$8); } '
3,372
Posted By elixir_sinari
Please post a representative sample of the input...
Please post a representative sample of the input and the corresponding expected output.

Without any samples, try this:
awk '{a1=$1;a2=$2;a5=$5;getline<"fileB";print a1,(a2-$2),(a5-$3)}' fileA
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 10:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy