Skip to main content
deleted 27 characters in body
Source Link

Couldn't resist :-)

<data.txt perl -pe 's/((.*?,){2})(.*)/\1ARRAY[\3]\1"{\3}"/'

X764_130520,0,ARRAY[0"{0.35,9.68,0.11,0.04,0.03,0,32.54,0.13,49.73,33.34,0.77,..]}"
X800_130701,0,ARRAY[2"{2.24,32.04,0.13,0.34,0.04,0,39.47,0.51,44.92,...]}"
X218_120425,6,ARRAY[2"{2.48,20.62,0,0.22,0,0,59.06,0.11,86.48,62.63,1.09,110.83,...]}"
X266_120430,6,ARRAY[2"{2.66,19.95,0.05,0.13,0.1,0,39.72,0.32,41.78,40.78,1.03,...]}"
X276_120430,6,ARRAY[2"{2.45,14.64,0,0.06,0.1,0,60.77,0.34,88.92,59.66,...]}"
X411_120503,6,ARRAY[3"{3.33,28.23,0,0.19,0.04,0,54.92,0.52,64.29,53.62,0.7,...]}"
X448_120507,6,ARRAY[2"{2.48,22.98,0,0.08,0,0,46.58,0.25,67.85,57.76,...]}"
X517_120515,6,ARRAY[3"{3.5,30.19,0.07,0.07,0.03,0.02,51.38,0.25,67.89,56.2,1.07,...]}"

Couldn't resist :-)

<data.txt perl -pe 's/((.*?,){2})(.*)/\1ARRAY[\3]/'

X764_130520,0,ARRAY[0.35,9.68,0.11,0.04,0.03,0,32.54,0.13,49.73,33.34,0.77,..]
X800_130701,0,ARRAY[2.24,32.04,0.13,0.34,0.04,0,39.47,0.51,44.92,...]
X218_120425,6,ARRAY[2.48,20.62,0,0.22,0,0,59.06,0.11,86.48,62.63,1.09,110.83,...]
X266_120430,6,ARRAY[2.66,19.95,0.05,0.13,0.1,0,39.72,0.32,41.78,40.78,1.03,...]
X276_120430,6,ARRAY[2.45,14.64,0,0.06,0.1,0,60.77,0.34,88.92,59.66,...]
X411_120503,6,ARRAY[3.33,28.23,0,0.19,0.04,0,54.92,0.52,64.29,53.62,0.7,...]
X448_120507,6,ARRAY[2.48,22.98,0,0.08,0,0,46.58,0.25,67.85,57.76,...]
X517_120515,6,ARRAY[3.5,30.19,0.07,0.07,0.03,0.02,51.38,0.25,67.89,56.2,1.07,...]

Couldn't resist :-)

<data.txt perl -pe 's/((.*?,){2})(.*)/\1"{\3}"/'

X764_130520,0,"{0.35,9.68,0.11,0.04,0.03,0,32.54,0.13,49.73,33.34,0.77,..}"
X800_130701,0,"{2.24,32.04,0.13,0.34,0.04,0,39.47,0.51,44.92,...}"
X218_120425,6,"{2.48,20.62,0,0.22,0,0,59.06,0.11,86.48,62.63,1.09,110.83,...}"
X266_120430,6,"{2.66,19.95,0.05,0.13,0.1,0,39.72,0.32,41.78,40.78,1.03,...}"
X276_120430,6,"{2.45,14.64,0,0.06,0.1,0,60.77,0.34,88.92,59.66,...}"
X411_120503,6,"{3.33,28.23,0,0.19,0.04,0,54.92,0.52,64.29,53.62,0.7,...}"
X448_120507,6,"{2.48,22.98,0,0.08,0,0,46.58,0.25,67.85,57.76,...}"
X517_120515,6,"{3.5,30.19,0.07,0.07,0.03,0.02,51.38,0.25,67.89,56.2,1.07,...}"
Source Link

Couldn't resist :-)

<data.txt perl -pe 's/((.*?,){2})(.*)/\1ARRAY[\3]/'

X764_130520,0,ARRAY[0.35,9.68,0.11,0.04,0.03,0,32.54,0.13,49.73,33.34,0.77,..]
X800_130701,0,ARRAY[2.24,32.04,0.13,0.34,0.04,0,39.47,0.51,44.92,...]
X218_120425,6,ARRAY[2.48,20.62,0,0.22,0,0,59.06,0.11,86.48,62.63,1.09,110.83,...]
X266_120430,6,ARRAY[2.66,19.95,0.05,0.13,0.1,0,39.72,0.32,41.78,40.78,1.03,...]
X276_120430,6,ARRAY[2.45,14.64,0,0.06,0.1,0,60.77,0.34,88.92,59.66,...]
X411_120503,6,ARRAY[3.33,28.23,0,0.19,0.04,0,54.92,0.52,64.29,53.62,0.7,...]
X448_120507,6,ARRAY[2.48,22.98,0,0.08,0,0,46.58,0.25,67.85,57.76,...]
X517_120515,6,ARRAY[3.5,30.19,0.07,0.07,0.03,0.02,51.38,0.25,67.89,56.2,1.07,...]