Attach session numbers to its relevant IDs
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have long records were collected as an output of a code,
Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
Session=10 70000
Session=11 80000
Session=9 90000
I want to organize the data like this
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
how can i do that
text-processing text-formatting
New contributor
add a comment |Â
up vote
0
down vote
favorite
I have long records were collected as an output of a code,
Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
Session=10 70000
Session=11 80000
Session=9 90000
I want to organize the data like this
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
how can i do that
text-processing text-formatting
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have long records were collected as an output of a code,
Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
Session=10 70000
Session=11 80000
Session=9 90000
I want to organize the data like this
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
how can i do that
text-processing text-formatting
New contributor
I have long records were collected as an output of a code,
Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
Session=10 70000
Session=11 80000
Session=9 90000
I want to organize the data like this
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
how can i do that
text-processing text-formatting
text-processing text-formatting
New contributor
New contributor
edited 3 mins ago
Jeff Schaller
33.8k851113
33.8k851113
New contributor
asked 3 mins ago
Simon Q
283
283
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
awk
can do it:
awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
awk
can do it:
awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
add a comment |Â
up vote
0
down vote
awk
can do it:
awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
add a comment |Â
up vote
0
down vote
up vote
0
down vote
awk
can do it:
awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
awk
can do it:
awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1
Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000
answered 42 secs ago
Goro
8,47254283
8,47254283
add a comment |Â
add a comment |Â
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474936%2fattach-session-numbers-to-its-relevant-ids%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password