Break Column nth in a CSV file into two

Hi Guys,

Need help with logic to break Column nth in a CSV file into two

for e.g

Refer below the second column as the nth column

 
"abcd","[/place/asia/india/mumbai,/product/sw/tomcat]","type/beta-version"

need output in a following format

 
"abcd","/place/asia/india/mumbai","/product/sw/tomcat","type/beta-version"

:confused:

any help is greatly appreciated.
thanks in advance

Hope this helps you

awk -F, '{ for(i=1;i<=NF;i++){
    if($i ~ /^\"/ && $i !~ /\"$/){$i=$i"\""}
    if($i ~ /\"$/ && $i !~ /^\"/){$i="\""$i}S=S?S FS $i : $i}
    gsub(/[][]/,"",S)
    print S;S=""}' file

thank a ton for such a quick reply

its definitely working for the above e.g ,wanted to implement this for large dataset and restrict this parsing to apply on particular column, say column 16.

can you please drop a hint.

thanks in advance

for 16th column only
try

awk -F, '{if($16 ~ /^\"/ && $16 !~ /\"$/){$16=$16"\""}
    if($16 ~ /\"$/ && $16 !~ /^\"/){$16="\""$16}
    gsub(/[][]/,"",$16)}1' file

for some reason this is not working..

Corrected my previous post. Please check.