Search Results

Search: Posts Made By: jghi123
16,653
Posted By joeyg
Unsure of your problem
Your first command seems to have correct syntax.

$ cat sample5.txt
A|T|X|G
G|X|T|A
G|T|A|X

$ awk 'BEGIN {OFS=FS="|"} {if ($2=="T")sub($1,"T"); print }' sample5.txt
T|T|X|G
G|X|T|A
T|T|A|X
3,427
Posted By vgersh99
YMMV: nawk -F, 'FNR==NR{f2[$1]=$2;next} $2+0 in...
YMMV:
nawk -F, 'FNR==NR{f2[$1]=$2;next} $2+0 in f2 {$3=f2[$2+0]}1' OFS=, file2 file1
Showing results 1 to 2 of 2

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