Search Results

Search: Posts Made By: eagle_fly
963
Posted By eagle_fly
thanks, both solutiuons work well!
thanks, both solutiuons work well!
963
Posted By eagle_fly
Thanks, but the rest of the file can be quite big...
Thanks, but the rest of the file can be quite big aND not necessarily starting with 1 2.
I want the part after the second --- no matter what it is.
963
Posted By eagle_fly
Discard part of a file based on a pattern ---
I have the file:

s3_T0(2) Pos "1" "2"
s1_T1(2) Pos "1" "2"
---
0 0
1 0
0 1
1 1
---
1 2 "tau0"
1 2 "h10"

I want to patternmatch on ---
and get only the third part i.e.

1 2 "tau0"...
2,379
Posted By eagle_fly
pamu, this makes perfect sense. However, it...
pamu, this makes perfect sense.
However, it seems to not work.
awk '{gsub("\"","");A[$1]=A[$1]?A[$1]", "$3":"$2:$1" "$3":"$2;if(!B[$1]++){C[++a]=$1}}END{print "max ", C[a]; for(i=1;i<=a;i++){print...
2,379
Posted By eagle_fly
Thanks for great solutions!:b: I want to...
Thanks for great solutions!:b:

I want to print the largest id, i.e. C[i] for the max i.
I can see how to run another for loop, but is there a better way?
2,379
Posted By eagle_fly
pamu. Thanks for your help. Somehow I get...
pamu.

Thanks for your help.
Somehow I get the supposedly first line to be always at the end.
Any idea why that is?

E.g. for the above example

2 h1:1, h2:2;
1 t1:2, h1:3;
2,379
Posted By eagle_fly
Awk: group rows by id and simple conversion
Hi all,

I am a newbie to awk and trying to learn by doing examples.
I got stuck at this relatively simple conversion.
The start file looks like:
1 2 "t1"
1 3 "h1"
2 1 "h1"
2 2 "h2"

and...
Showing results 1 to 7 of 7

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