Hi all ,
I have the following string
"raj,234,,,asur t,valol"
I am using the following code to parse that line into an array.
but I want to take the comma into the array.like "raj , asurt valol "
But the array is filling as bellow
" raj undef undef asurt valol"
Can any one help me to read this String.
Thanks
Naveen
I have the following string
"raj,234,,,asur t,valol"
I am using the following code to parse that line into an array.
Code:
push(@value, $+) while $tmp2[2] =~ m{"([^\"\\]*(?:\\.[^\"\\]*)*)",? | ([^,]+),? | , }gx;
push(@value, undef) if substr($tmp2[2], -1,1) eq ',';
But the array is filling as bellow
" raj undef undef asurt valol"
Can any one help me to read this String.
Thanks
Naveen
Comment