Hi There
I needed to write a Unix shell script which will pick up the data from a .CSV file and reformat it as per the requirement and write it to another .CSV file.
Currently I am in the proess of Data Import to "Remedy System" (A one kind of incident mangement Application) and this application accepts the Data in a particular format, Hence I want to accomplish this task with the Script without manual intervension.
My Original data loooks some what like this,
AcquiredMethod, AssetID, AssetLifecycleStatus, SC1, SC2, DC1, DC2
Vendor Owned, ATESTIMPORT10, Down, a, b, c, d
This has to be re-formatted like this
AcquiredMethod, AssetID, AssetLifecycleStatus, C, S/D, 1or2
Vendor Owned, ATESTIMPORT10, Down, a, S, 1
Vendor Owned, ATESTIMPORT10, Down, b, S, 2
Vendor Owned, ATESTIMPORT10, Down, c, D, 1
Vendor Owned, ATESTIMPORT10, Down, d, D, 2
I know I am a bad in explaining, however if you go through the excel it will be little clear.
The condition is if there is no data in any of the 4 columns (SC1 or SC2 or SC3 or SC4) the same record will not be present in the out CSV file.
Can anyone please give the script for the above task. I would really appreciate that.
Thanks in Advance,
Uday