I have copied three columns to a file but need to change the format of one column (map).
echo "copy admin.product (my_references, id, my_date) to 'updateProductStatement.cql';" > copyInputs.cql
Output file looks like:
,4.IM-H-506X,2016-01-01 11:07:27-0500
['LOWERCASETEST7'],JASONTEST7,2015-04-19 00:00:00-0400
"['EPROSP_IWS', '648099_EPROSP_IWS']",4.NDR-IWS-EPRO,2015-04-16 08:04:21-0400
After copying the data I tried the below command to separate all the columns:
sed "s/' *, *'/' '/g;s/\([^,]*\),\([^,]*\),\(.*\)/update table set cola = \1 where colb = \2 and colc = \3/;s/' '/','/g" tempFile > updatestmt.cql
I get output like this:
update table set cola = where colb = E2Bn9 and colc = 2015-04-29 00:00:00-0500
update table set cola = ['2C173'] where colb = E2BA8 and colc = 2015-04-29 00:00:00-0500
update table set cola = "['5A475' where colb = '2C174'] and colc = E2BA8
Here I want to insert something in this format for my 1st column as {'my_refrences':''}.
So my expected output file will look like:
{"['EPROSP_IWS', '648099_EPROSP_IWS']":""},4.NDR-IWS-EPRO,2015-04-16 08:04:21-0400
Any help or siggestion? I am very much new to the scripting world.