Even if you got this to work, will it give you the correct result? In your list there are the numbers "1", "2", and "3". It seems that the intent with sed is to match "1,", "2,", and "3,", respectively. So, if the data is "1,2,3,101,102,103,201,202,203,500", the result would be:
After s/1,//g: 2,3,10102,103,20202,203,500
After s/2,//g: 3,1010103,2020203,500
After s/3,//g: 101010202020500
That is what your commands will accomplish. Is this the desired result?
Or should the result after handling "1", "2", an "3" in the list be the removal of the first three digits in the sequence, with the final output being "101,102,103,201,202,203,500" ?
In short, should the items in the list be allowed to match partial numbers in the data? If not, your approach requires modification, because that sed command allows partial matches.
Regards,
Alister
Last edited by alister; 05-20-2010 at 12:43 PM..