Search Results

Search: Posts Made By: jamie_123
6,563
Posted By RudiC
The ~ matches any occurence of the search...
The ~ matches any occurence of the search pattern in the string, regardsless of its position. You can anchor the pattern at the start (with ^ ) or at the end (with $ ) of the string as I did with...
6,563
Posted By RavinderSingh13
Hello Jamie, Following may help you. Let's...
Hello Jamie,

Following may help you. Let's say we have following input file.

cat test121
TEST1211
TEST
RTEST
Now example of ^.

awk '/^R/' test121
RTEST
Means it will show all text...
6,563
Posted By RudiC
That's because there's many "0"s in them there...
That's because there's many "0"s in them there numbers, so the range immediately starts again (and doesn't get stopped any more). Try to anchor the "0":awk -v s="$start" -v e="$end" '$0~"^"s,$0~e'...
6,563
Posted By RavinderSingh13
Hello Jamie_123, Following may help you...
Hello Jamie_123,

Following may help you in same.

awk -vstart=1 -vend=6 '(NR>=start && NR<=end)' Input_file

I have just given example for values of start and end variables, you can...
2,314
Posted By bakunin
It is much easier than you are thinking: a UNIX...
It is much easier than you are thinking: a UNIX system (your Linux, as i can tell you use, is no exception) has a (theoretically) unlimited amount of possible terminals attached via "serial lines"...
1,216
Posted By RavinderSingh13
Hello Jamie_123, Following may help you to...
Hello Jamie_123,

Following may help you to be more specific. Let me know if this helps.

awk '{match($0,/\&range.*\&reef/);print substr($0,RSTART+7,RLENGTH-12)}' Input_file
Output will be as...
1,216
Posted By RavinderSingh13
Hello Jamie_123, Following may help you in...
Hello Jamie_123,

Following may help you in same.

awk '{match($0,/\=.*\&/);print substr($0,RSTART+1,RLENGTH-2)}' Input_file
Output will be as follows.

0-1000
1000-10000
Thanks,
R....
1,951
Posted By Aia
perl -pe 's/(<HTTPFlow)\n/$1 /' jamie.file ...
perl -pe 's/(<HTTPFlow)\n/$1 /' jamie.file

---------- Post updated at 09:35 AM ---------- Previous update was at 08:23 AM ----------

awk '/<HTTPFlow$/ {printf $0;next}1' jamie.file
1,951
Posted By RudiC
Try alsoawk '/<HTTPFlow$/ {getline X; $0 = $0 X}...
Try alsoawk '/<HTTPFlow$/ {getline X; $0 = $0 X} 1' file
1,951
Posted By RavinderSingh13
Hello Jamie_123, Following may help you in...
Hello Jamie_123,

Following may help you in same.

awk '(NR%2==0){A=$0;getline;print A OFS $0;NR++;next};{print}' Input_file
Output will be as follows.

Matches filter:
'request ',...
1,366
Posted By SriniShoo
awk 'NR == FNR {a[$1] = $3; next} {print $1,...
awk 'NR == FNR {a[$1] = $3; next} {print $1, (a[$1] == "" ? "nomatch" : a[$1])}' file2 file1
1,366
Posted By RavinderSingh13
Hello Jamie_123, You could try following...
Hello Jamie_123,

You could try following also, which may help you in same.

awk 'FNR==NR{X[$1]=$3;next} ($1 in X){print $1 OFS X[$1]}' file2 file1
Output will be as follows.

243 360
242...
2,647
Posted By Corona688
I doubt that WINE will help you. It would not...
I doubt that WINE will help you. It would not run things inside it in "real mode". You'd need to actually boot a DOS environment of some sort.
2,647
Posted By hicksd8
Run it anyway you can. In older machines with a...
Run it anyway you can. In older machines with a floppy drive I've seen the config utility put onto a DOS bootable floppy and run from there.

Just go for it. Either the environment will run it...
3,865
Posted By RudiC
Sorry for the confusion and the "typo". I have a...
Sorry for the confusion and the "typo". I have a set of temp files to play with, and sometimes it escapes me to edit the file name in the post. As Don Cragun said, replace that temp file name with...
3,865
Posted By Don Cragun
Assuming you don't care about preserving the...
Assuming you don't care about preserving the hundreds of spaces at the ends of some of your input lines (since the spacing in your sample output lines does not match the spacing in your sample input...
3,865
Posted By RudiC
Trypaste -s -d"\t\t\n" file2 | LC_ALL=C sort -n |...
Trypaste -s -d"\t\t\n" file2 | LC_ALL=C sort -n | tr '\t' '\n'
0
0.181017
0.181017
0.0409129
0.214896
0.214896
0.781925
1.05696
1.05696
0.791026
1.10494
1.10494
1.29588
15.6751
15.6751...
1,934
Posted By Akshay Hegde
@ Scrutinizer : elegant solution :b: Not one...
@ Scrutinizer : elegant solution :b:

Not one liner solution, I just wanted to share this function, you can try this

awk '

# Array, nearest neighbour using simple min-max method
function...
1,934
Posted By Scrutinizer
Alternatively: awk '$1+0>p+0{if(NR>1)print...
Alternatively:
awk '$1+0>p+0{if(NR>1)print $1-p,$1 "-" p; if(!((getline p<f)>0)) exit}' f=file1 file2
1,934
Posted By RudiC
What be the desired output? Tryawk 'FNR==NR...
What be the desired output? Tryawk 'FNR==NR {T[NR]=$1; CNT=1; next} {D=$1-T[CNT];if (D>0) {print D, $1, T[CNT]; CNT++}}' file1 file2
4.2 22.4 18.2
7.3 89.4 82.1
---------- Post updated at 11:20...
1,504
Posted By RavinderSingh13
Hello jaime_123, You can remove the use of...
Hello jaime_123,

You can remove the use of variable here.


awk 'BEGIN{}
{
print $2 - $1;
}
END{if(NR==0){
print "0"
}
}' Input_file


Thanks,
R. Singh
1,504
Posted By Scrutinizer
You're welcome. It is not entirely surprising.....
You're welcome. It is not entirely surprising.. If the variable a is not initialized then it is the empty string ("").. So $a becomes $"".

Some awks may interpret it in a numerical context and...
1,504
Posted By Scrutinizer
The problem is the use of the variable name $a ....
The problem is the use of the variable name $a . Change this to a and all should be fine..
982
Posted By Chubler_XL
On cygwin if you want a good shell to test bourne...
On cygwin if you want a good shell to test bourne shell script try ash or dash
982
Posted By junior-helper
Do you mean it works in the terminal as well as...
Do you mean it works in the terminal as well as in script under cygwin? If yes, then there's a simple explanation for that: In cygwin /bin/sh is actually bash...
Showing results 1 to 25 of 62

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