Have a text file with so many contents like this:
AllocatedStorage : 5
InstanceName : snapshotinstance
SnapshotName : Testsnapshot
SnapshotCreateTime : 8/26/2015 8:34:47 AM
AllocatedStorage : 5
InstanceName : snapshotinstance
SnapshotName : Backupsnapshot
SnapshotCreateTime : 7/31/2015 8:00:00 AM
I need to read a specific string (which is read from another file) and if an exact match is found then I need to retrieve another string which is there within that block. For example, suppose if my search string is "7/31/2015 8:00:00 AM" then I need to retrieve SnapshotName for that specific block.
Is there a way to achieve this? Any help would be really appreciated.