awk -F"\t" -vOFS="\t" '{print $1"\t-\t-","["$4,$5"]",$6,$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv
Using the above command how to remove the string www.abc.com from the $7 value.
awk -F"\t" -vOFS="\t" '{print $1"\t-\t-","["$4,$5"]",$6,$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv
Using the above command how to remove the string www.abc.com from the $7 value.
gsub("www\.abc\.com","",$7)
cat tab.tsv | awk -F"\t" '{print $6}'
will give the result
GET http://www.abc.com/tracker.js.php?b370 HTTP/1.1
How to remove the string "http://www.abc.com".
Hi,
awk -F"\t" 'gsub ("http://www.abc.com","",$6)' tab.tsv
Can you please tell me how to use inside
awk -F"\t" -vOFS="\t" '{print $1"\t-\t-","["$4,$5"]",'gsub ("http://www.abc.com","",$6)',$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv
This doesnt work
Hi,
awk -F"\t" -vOFS="\t" '{gsub ("http://www.abc.com","",$6);print $1"\t-\t-","["$4,$5"]",$6,$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv
If I have to make www.$var.com, it doesn't work
awk -F"\t" -vOFS="\t" '{gsub ("http://www.$var.com","",$6);print $1"\t-\t-","["$4,$5"]",$6,$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv
---------- Post updated at 02:30 AM ---------- Previous update was at 01:51 AM ----------
[/COLOR]
#!/bin/bash
name='xyz'
echo $name
awk -F"\t" 'gsub ("http://articles.$name.com","",$6)' tmp.tsv
Why this $name is not read as a variable. How to make it as a variable
#!/bin/bash
name='abc'
echo $name
awk -F"\t" -vv1=$name 'BEGIN{OFS="\t"} {gsub ("http://www."v1".com","",$6);print $1"\t-\t-","["$4,$5"]",$6,$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv