I want to add single quotes on every row
by neroja from LinuxQuestions.org on (#4VR6V)
Input in a file is :
HCCurmonth,Oct
HCCurYear,2018
FunnelCurmonth,Oct
Fncuryr,2018
FVCurmonth,Jul
Funnelcuryear,2019
Curmonth,Oct
Curyear,2019
prevmonth,Sep
ETPFcode,5101,5201
ETPAccyrmonth,201903
I want output as below
'HCCurmonth','Oct'
'HCCurYear','2018'
'FunnelCurmonth','Oct'
'Fncuryr','2018'
'FVCurmonth','Jul'
'Funnelcuryear','2019'
'Curmonth','Oct'
'Curyear','2019'
'prevmonth','Sep'
'ETPFcode','5101,5201'
'ETPAccyrmonth','201903'
I want to put quotes at the front of each line, end of each line, left of 1st comma(,) and right of 1st comma(,) and make a separate file, use it for loading data to database.
I want to write a unix shell script to do this preferably a bash script.
Please help


HCCurmonth,Oct
HCCurYear,2018
FunnelCurmonth,Oct
Fncuryr,2018
FVCurmonth,Jul
Funnelcuryear,2019
Curmonth,Oct
Curyear,2019
prevmonth,Sep
ETPFcode,5101,5201
ETPAccyrmonth,201903
I want output as below
'HCCurmonth','Oct'
'HCCurYear','2018'
'FunnelCurmonth','Oct'
'Fncuryr','2018'
'FVCurmonth','Jul'
'Funnelcuryear','2019'
'Curmonth','Oct'
'Curyear','2019'
'prevmonth','Sep'
'ETPFcode','5101,5201'
'ETPAccyrmonth','201903'
I want to put quotes at the front of each line, end of each line, left of 1st comma(,) and right of 1st comma(,) and make a separate file, use it for loading data to database.
I want to write a unix shell script to do this preferably a bash script.
Please help