Search Results

Search: Posts Made By: Raghuram717
4,298
Posted By MadeInGermany
GNU sed and maybe BSD sed support ExtendedRE with...
GNU sed and maybe BSD sed support ExtendedRE with a - r or -E option.
Then you can do a universal search:
sed -i -r '/(^|,)GETaboutUsCSS(,|$)/d' file
At the left side there must be either the...
4,298
Posted By Neo
Maybe try adding the "end of line" directive to...
Maybe try adding the "end of line" directive to your REGEX?

You can use $ to match the end of your REGEX, if you want to try.
4,298
Posted By MadeInGermany
Have a ^ anchor for the beginning of the line,...
Have a ^ anchor for the beginning of the line, and a $ anchor for the end of the line:
sed -i '/^GETaboutUsCSS$/d' file
2,213
Posted By RudiC
You're close. Try sed -r...
You're close. Try
sed -r 's/([0-9])\/([0-9])/\1\t\2/' file
view pz19a0c0 1000T_J_3MoDw9DSLh1ZsCubdua-LKOQmbtiVgkIsiMbSiwF467?sessionId=15451401994597121249
view pz19a0c0 ...
2,734
Posted By RudiC
Try awk ' {X = 3 + int((NF-2) *...
Try
awk '
{X = 3 + int((NF-2) * rand())
print $(X-2), $(X-1), $X
}
' file
1,886
Posted By RavinderSingh13
Hello Raghuram717, Could you please try...
Hello Raghuram717,

Could you please try following(haven't tested it though).


awk '/^sdg-catalog/{close(file);file=$0;next} {print > file}' Input_file


Thanks,
R. Singh
1,886
Posted By Scrutinizer
Slight correction to Ravinder's suggestion: awk...
Slight correction to Ravinder's suggestion:
awk '/^sdg-catalog/{close(file);file=$0;next} {print > file}' Input_file
5,270
Posted By RudiC
That script should not output anything as BDT...
That script should not output anything as BDT will be calculated to be zero, the epoch origin, and any timestamp in the data file will yield HCNT (hour count) gt 23 and force the script to exit.
But...
4,384
Posted By RudiC
And, BTW, you might want to consider combining...
And, BTW, you might want to consider combining the solutions in this thread with the ones in your other thread...
4,384
Posted By RudiC
In shell "pattern matching", (cf man bash). So,...
In shell "pattern matching", (cf man bash). So, [1-24] matches 1, 2, and 4. For your case, you might want to try "brace expansion" (cf man bash):
echo file{1..24}
file1 file2 file3 file4 file5...
2,608
Posted By RudiC
Try this for merging data according to the field...
Try this for merging data according to the field 1 values, trying to keep the order of lines to the first file's. It partly takes care of $1 values disappearing or newly occurring, but does not care...
4,384
Posted By RudiC
Try awk -F, ' NR == 1 {for (i=1;...
Try
awk -F, '
NR == 1 {for (i=1; i<=NF; i++) if ($i == SRCH) COL=i
HD = $1
}
FNR == 1 {FCNT++
HD = HD OFS SRCH
...
2,750
Posted By vgersh99
a bit verbose, but try: awk -f rag.awk file1...
a bit verbose, but try: awk -f rag.awk file1 file2 where rag.awk is:

BEGIN {
FS=OFS=","
}
{idx=$1 OFS $2; _34=$3 OFS $4}
FNR==NR {if (FNR>1) f1[idx]=_34; next}
idx in f1 { print idx,...
Showing results 1 to 13 of 13

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