Search Results

Search: Posts Made By: kieranfoley
Forum: Web Development 12-08-2017
19,931
Posted By jgt
When you use curl from your workstation, you are...
When you use curl from your workstation, you are connecting from your workstation. However, when you connect through the web page you are connecting from the web server. The problem may be the two...
4,448
Posted By neutronscott
"The Awk Programming Language" (Aho, Kernighan...
"The Awk Programming Language" (Aho, Kernighan and Weinberger, 1988) is still highly recommended by #awk on freenode IRC.
4,448
Posted By jim mcnamara
To maximize the potential of awk you need to have...
To maximize the potential of awk you need to have a good understanding of regular expressions as well. ...my opinion.

This book: sed & awk, 2nd Edition - O'Reilly Media...
1,205
Posted By MadeInGermany
Better loop over the fields, and the look-up in...
Better loop over the fields, and the look-up in the array is exact and maybe even faster.
awk 'NR==FNR {T[$3]=$0; next} {for (i=1;i<=NF;i++) if ($i in T) print T[$i], $1}' FS=, OFS=, file[12]
...
1,205
Posted By RudiC
More like awk 'NR==FNR {T[$3]=$0; P[$3]; next}...
More like awk 'NR==FNR {T[$3]=$0; P[$3]; next} {for (t in T) if ($0 ~ t) {print T[t], $1; delete P[t]}} END {for (p in P) print T[p]}' FS=, OFS=, file[12]

---------- Post updated at 16:39...
1,832
Posted By RudiC
Wouldn't this be simpler?awk -F,...
Wouldn't this be simpler?awk -F, 'FNR==NR{A[$2]=$1;next} ($8 in A){$9=A[$8]} 1' OFS=, file2 file1
1,832
Posted By RavinderSingh13
Yes, that's correct. I think you had a typo, you...
Yes, that's correct. I think you had a typo, you should add Input_file names too as follows.

awk -F, 'FNR==NR{A[$2]=$1;next} ($8 in A){$9=A[$8];print $0} !($8 in A){print $0}' OFS=, Input_file...
1,407
Posted By RudiC
Try (untested): awk ' /^fc/ {if...
Try (untested):
awk '
/^fc/ {if (A) print A, B, C, D; L=0; A=B=C=D=""}
END {if (A) print A, B, C, D}
/fc.*up/ {A=$1; L=1}
/^ *Port/ && L {B=$4}
/^ *Speed/...
1,223
Posted By chacko193
Try: awk 'NR==FNR{arr[$1]=$2;next}{for(ele in...
Try:
awk 'NR==FNR{arr[$1]=$2;next}{for(ele in arr) {if ($1 ~ ele) {$1=arr[ele]}}}1' file1 file2
3,897
Posted By SriniShoo
awk '$NF ~ /G/ {$NF *= 1024}1 $NF ~ /T/ {$NF *=...
awk '$NF ~ /G/ {$NF *= 1024}1 $NF ~ /T/ {$NF *= 1048576}1' file
1,847
Posted By RudiC
Try alsoawk '/initi/ {if (!sub(/]$/,"&"))...
Try alsoawk '/initi/ {if (!sub(/]$/,"&")) {getline X; gsub(/^ +/," ", X); $0=$0 X}; print}' file
initiators [NETIK0102_UCS_Boot_a, NETIK0102_UCS_Boot_b]
initiators ...
Showing results 1 to 11 of 11

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