I need to parse a string which looks like
"xyx","sdfsdf","asf_asdf"
into
var1="xyx"
var2="sdfsdf"
var3="asf_asdf"
I need to parse a string which looks like
"xyx","sdfsdf","asf_asdf"
into
var1="xyx"
var2="sdfsdf"
var3="asf_asdf"
Can you elaborate this problem little more,i could not get exactly what u want.
I read the line "xyx","asdfsd","qweerqw_adfad"
from a input text file, i need to separate out the data from this single string into separate variables like
"xyx"
"asdfsd"
"qweerqw_adfad"
One quick and dirty solution (if this is what you need)
var1=`echo "xyx","sdfsdf","asf_asdf" | cut -f 1 -d","`
var2=`echo "xyx","sdfsdf","asf_asdf" | cut -f 2 -d","`
var3=`echo "xyx","sdfsdf","asf_asdf" | cut -f 3 -d","`
Try to generalize it using a script.