Sorting blocks of data based on a particular row of data

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I was given the below script by this great community to help sort the rows of information.
BEGIN
FS=":"
PROCINFO["sorted_in"]="@val_str_asc";
/./
values[$1]=$0
/^$/
asort(values)
for (element in values)
print values[element]
print ""
delete values
END
asort(values)
for (element in values)
print values[element]
Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
Desired result:
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
sort
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
I was given the below script by this great community to help sort the rows of information.
BEGIN
FS=":"
PROCINFO["sorted_in"]="@val_str_asc";
/./
values[$1]=$0
/^$/
asort(values)
for (element in values)
print values[element]
print ""
delete values
END
asort(values)
for (element in values)
print values[element]
Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
Desired result:
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
sort
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I was given the below script by this great community to help sort the rows of information.
BEGIN
FS=":"
PROCINFO["sorted_in"]="@val_str_asc";
/./
values[$1]=$0
/^$/
asort(values)
for (element in values)
print values[element]
print ""
delete values
END
asort(values)
for (element in values)
print values[element]
Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
Desired result:
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
sort
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I was given the below script by this great community to help sort the rows of information.
BEGIN
FS=":"
PROCINFO["sorted_in"]="@val_str_asc";
/./
values[$1]=$0
/^$/
asort(values)
for (element in values)
print values[element]
print ""
delete values
END
asort(values)
for (element in values)
print values[element]
Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
Desired result:
cabLoginID:053XCDTF8D4J6PD3BG8P
loginName:jack
memoryInfo:jsHeapSizeLimit:2217857988
session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z
totalJSHeapSize:42358792
usedJSHeapSize:36482584
userAgent:Mozilla/5.0
cabLoginID:05P4X6K6GFPJ7K31EJ7H
loginName:bob
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z
totalJSHeapSize:54501376
usedJSHeapSize:35478968
userAgent:Mozilla/5.0
cabLoginID:0557CAWG0FP27K31JG7Q
loginName:john
memoryInfo:jsHeapSizeLimit:2181038080
session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z
totalJSHeapSize:36675584
usedJSHeapSize:29721040
userAgent:Mozilla/5.0
sort
sort
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 20 mins ago
Kam
63
63
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Kam is a new contributor. Be nice, and check out our Code of Conduct.
Kam is a new contributor. Be nice, and check out our Code of Conduct.
Kam is a new contributor. Be nice, and check out our Code of Conduct.
Kam is a new contributor. Be nice, and check out our Code of Conduct.
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%2f477807%2fsorting-blocks-of-data-based-on-a-particular-row-of-data%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