I have comma seperated values in a flat file, example below:

RStndrd,Mer,1902 PAR GRN,ParentGroup,

I am interested in getting the third parameter from above, (1902 PAR GRN) in a variable called MyID...i am using the command below to get the third variable

MyID=`echo $line|cut -f3 -d ","`

but using the above command returns the value of MyID as just 1902

i want the value of MyID to be 1902 PAR GRN including all the spaces...how do i that??

any help will be greatly appreciated!

It should work. Doesn't you check content of that variable in some evalution without quotes around it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.