Find replace a particular string of data with wildcard

Hi

I am having a csv file in which lots of data are available wherein i need to find a particular kind of data and replace it with null value.

here is the sample data..

I need to find the string starting with 404-064- and up to the first space i have to remove the data and keep the remaining data as it is.

i.e the result expected is

how to achieve this?

tr  " " "\n" <file |grep -v 404-064- | tr "\n" " "

Hi.

Your desired output is slightly ambiguous (much shorter than it should look).

$ sed "/404-064-/ s/[^ ]* //" file

Gives:

404-64-401-2081 404-064-3204-204-10721 404-064-3204-204-10653 404-064-3204-204-10652 404-064-3204-204-10651 404-64-401-2082 404-64-401-2251 404-64-401-2253 404-64-401-2093 404-64-401-2083

I used the number 404-64-401-2081 from your output as a reference.

Plus, for a CSV, I don't see any comma's :slight_smile:

hi,

i have given only one column value in the data provided...and moreover i need to find and replace whereever that 404-064-xxxx-xxx-xxxx (any length upto space) has to be removed...

Hi

sed -r "s/404-064-[0-9-]+ //g" file

Guru.