This is the type of data I'm working with:
GUEST
DN: apple
DS: G-WE01-E20A-SLS-4
DS: G-WE01-E203-SLS-4
GUEST
DN: grape
DS: G-WE01-E20B-SLS-4
GUEST
DN: banana
DS: G-WE01-E20A-SLS-4
DS: G-WE01-E200-SLS-4
I have two records here, the "GUEST" line I can use as my record separator.
Basically I'd like to organize my records by the line that begins with "DS" and include the "DN" data.
Desired output:
G-WE01-E20A-SLS-4
apple
banana
G-WE01-E20B-SLS-4
apple
grape
G-WE01-E200-SLS-4
banana
In other words I'm trying to sort this so I can see all the "DN" names affiliated with each "DS".
GUEST
DN: apple
DS: G-WE01-E20A-SLS-4
DS: G-WE01-E203-SLS-4
GUEST
DN: grape
DS: G-WE01-E20B-SLS-4
GUEST
DN: banana
DS: G-WE01-E20A-SLS-4
DS: G-WE01-E200-SLS-4
I have two records here, the "GUEST" line I can use as my record separator.
Basically I'd like to organize my records by the line that begins with "DS" and include the "DN" data.
Desired output:
G-WE01-E20A-SLS-4
apple
banana
G-WE01-E20B-SLS-4
apple
grape
G-WE01-E200-SLS-4
banana
In other words I'm trying to sort this so I can see all the "DN" names affiliated with each "DS".