enthuguy
asked on
Best way to split and output to csv in bash
Hi EE
could you advise what is the best way to split attached sample file into 3 columns and output into a csv file in bash pls
Few lines from sample content
Oct 28, 2016 9:14:08,906 AM /job/CBD_LIC_FINISH_DEV_OD I_CCO/conf igSubmit by user1
Oct 28, 2016 9:42:49,933 AM /job/SCHEDULED_OSB_TRAVELL ERS_CARD/c onfigSubmi t by user2
Oct 28, 2016 9:42:53,591 AM /job/SCHEDULED_OSB_TRAVELL ERS_CARD/c onfigSubmi t by user2
Oct 28, 2016 11:26:29,374 AM /view/All/createItem by p751862
Would like extract like this...
column1 = Oct 28, 2016 9:14:08,906 AM
column2 = /job/CBD_LIC_FINISH_DEV_OD I_CCO/conf igSubmit
column3 = user1
Final output:
Oct 28, 2016 9:14:08,906 AM,/job/CBD_LIC_FINISH_DEV _ODI_CCO/c onfigSubmi t,user1
Oct 28, 2016 9:42:49,933 AM,/job/SCHEDULED_OSB_TRAV ELLERS_CAR D/configSu bmit,user2
Oct 28, 2016 9:42:53,591 AM,/job/SCHEDULED_OSB_TRAV ELLERS_CAR D/configSu bmit,user2
Oct 28, 2016 11:26:29,374 AM,/view/All/createItem,p7 51862
config.log
could you advise what is the best way to split attached sample file into 3 columns and output into a csv file in bash pls
Few lines from sample content
Oct 28, 2016 9:14:08,906 AM /job/CBD_LIC_FINISH_DEV_OD
Oct 28, 2016 9:42:49,933 AM /job/SCHEDULED_OSB_TRAVELL
Oct 28, 2016 9:42:53,591 AM /job/SCHEDULED_OSB_TRAVELL
Oct 28, 2016 11:26:29,374 AM /view/All/createItem by p751862
Would like extract like this...
column1 = Oct 28, 2016 9:14:08,906 AM
column2 = /job/CBD_LIC_FINISH_DEV_OD
column3 = user1
Final output:
Oct 28, 2016 9:14:08,906 AM,/job/CBD_LIC_FINISH_DEV
Oct 28, 2016 9:42:49,933 AM,/job/SCHEDULED_OSB_TRAV
Oct 28, 2016 9:42:53,591 AM,/job/SCHEDULED_OSB_TRAV
Oct 28, 2016 11:26:29,374 AM,/view/All/createItem,p7
config.log
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER