Link to home
Start Free TrialLog in
Avatar of enthuguy
enthuguyFlag for Australia

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_ODI_CCO/configSubmit by user1
Oct 28, 2016 9:42:49,933 AM /job/SCHEDULED_OSB_TRAVELLERS_CARD/configSubmit by user2
Oct 28, 2016 9:42:53,591 AM /job/SCHEDULED_OSB_TRAVELLERS_CARD/configSubmit 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_ODI_CCO/configSubmit
column3 = user1

Final output:
Oct 28, 2016 9:14:08,906 AM,/job/CBD_LIC_FINISH_DEV_ODI_CCO/configSubmit,user1
Oct 28, 2016 9:42:49,933 AM,/job/SCHEDULED_OSB_TRAVELLERS_CARD/configSubmit,user2
Oct 28, 2016 9:42:53,591 AM,/job/SCHEDULED_OSB_TRAVELLERS_CARD/configSubmit,user2
Oct 28, 2016 11:26:29,374 AM,/view/All/createItem,p751862
config.log
ASKER CERTIFIED SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enthuguy

ASKER

Thanks very much!