I have the below Raw log output of my software Installs and Upgrade times in a file. I need to record the progression of Software upgrades in Excel report and need the data in the expected output format. The beginning point is the Installation of the software and after that just upgrades are recorded in log.
- Raw log output:
BIOS1,01/16/21 16:27:34,INSTALL,version-19.001-355
BIOS1,01/17/21 11:04:48,UPGRADE,version-19.001-361
BIOS1,02/14/21 07:22:37,UPGRADE,version-19.001-366
BIOS1,02/15/21 14:23:09,UPGRADE,version-19.001-372
So basically i need info of software upgrade progression that happened from
version-19.001-355 -> version-19.001-361 -> version-19.001-366 -> version-19.001-372
The expected output needed for my report after merging of lines with conditions is below in csv format. There is info of From_Version upgrade to the To_Version with upgrade dates
Name, From_Version, Upgraded_Date_Time, State, To_Version
BIOS1, version-19.001-355, 01/17/21 11:04:48, UPGRADE, version-19.001-361
BIOS1, version-19.001-361, 02/14/21 07:22:37, UPGRADE, version-19.001-366
BIOS1, version-19.001-366, 02/15/21 14:23:09, UPGRADE, version-19.001-372
I tried to merge the lines using :
awk 'NR%2 {printf("%s", $0); next} {print $0} ' data.txt
but the data is just merged and am not able to get in the desired way.