Search Results

Search: Posts Made By: dendright
2,274
Posted By vidyadhar85
u can.. but bit messy though awk...
u can.. but bit messy though


awk '{v=substr($0,45,22);sub(/[ ]+/," ",v);print substr($0,0,44) v substr($0,68)}' filename
2,069
Posted By archimedes
if your lookup file is delimited, then you need...
if your lookup file is delimited, then you need to mention the FieldSeparator (FS) i.e. FS="|" in the BEGIN block before the while loop begins and then reassign it to FS = " " after the while loop...
2,069
Posted By Scrutinizer
I see. Quick fix in the UNIX tradition: sed...
I see. Quick fix in the UNIX tradition:
sed 's/\(.\{16\}\)...../\1_____/' inputfile |
awk 'NR==FNR{A[$1]=$2;next}{sub(/_____/,A[$(NF-2)])}1' lookupfile -

The first sed statement converts the...
1,036
Posted By radoulov
You could use awk: awk -F\| 'NR == FNR { ...
You could use awk:

awk -F\| 'NR == FNR {
_[FNR] = $0; next
}
{ $4 = _[FNR] }
1' OFS=\| fileB fileA
Showing results 1 to 4 of 4

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