Search Results

Search: Posts Made By: maya3
850
Posted By bakunin
You may want to start reading the man page of the...
You may want to start reading the man page of the join command. As i see it it does exactly what you want. Note that join expects both input files to be sorted (in regards to the common key you want...
6,402
Posted By Don Cragun
Let us be clear here. The above display is not...
Let us be clear here. The above display is not sample output from any file. The above display is not adapted output from any file. The above output is contrived output that is intended to confuse...
6,402
Posted By RudiC
That output doesn't seem to originally belong to...
That output doesn't seem to originally belong to the command you issued, and it certainly doesn't match the sample in post #1. Please apply utmost care when posting code and data!


Still from the...
1,259
Posted By Corona688
Correct, indentation makes it readable but...
Correct, indentation makes it readable but doesn't alter the logical flow.
2,240
Posted By vgersh99
$ awk ' {getline X < F2 n...
$ awk '
{getline X < F2
n = split (X, T)
for (i=1; i<=NF; i++) $i += T[i]
}
1
' F2="maya22.txt" maya11.txt
3.56367e-07 7.22077e-08 -2.38554e-08...
2,240
Posted By vgersh99
you can think of this as short hand for a long...
you can think of this as short hand for a long hand mnemonic of:

if (i==NF/2)
output ORS
else
output OFS
2,240
Posted By vgersh99
using your approach: paste file1 file2 |\ ...
using your approach:

paste file1 file2 |\
awk '{for(i=1;i<=NF/2;i++) printf("%s%s", $i+$((NF/2)+i), (i==NF/2)?ORS:OFS)}'
2,240
Posted By vgersh99
strange... given you sample files and the script:...
strange... given you sample files and the script:

#!/bin/ksh

paste maya1.txt maya2.txt |\
awk '{for(i=1;i<=NF/2;i++) printf("%s%s", $i+$((NF/2)+i), (i==NF/2)?ORS:OFS)}'



I get the...
2,025
Posted By RudiC
NR == 1 ... while it is reading the first line...
NR == 1 ... while it is reading the first line of the first file do everything in the curly brackets - YES
The for loop changes the value of n from the total...
2,025
Posted By RudiC
How about awk 'NR == 1 {for (n=split($0, T); n;...
How about
awk 'NR == 1 {for (n=split($0, T); n; n--) F1[T[n]]; next} !($1 in F1)' file[12]
10
10
200
200
50
Showing results 1 to 10 of 10

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