What am I missing???

Tool for Search and Replace across multiple files.
Post Reply
User avatar
Lou Meyer

What am I missing???

Post by Lou Meyer »

I have numerous text files that contain the following values at the beginning of various lines:

22;xxxx;x;x;..........

I want to replace specific values between each semi-colon for every occurrence regardless of the current values.

I find the records just fine using regular expressions as follows:

\n22;*;*;*;

but when I try to replace the values I want they are inserted rather than replacing the values.

Example: Found 22;XXXX:YY;Z; replace = \n22;AAAA;BB;C;
updated data 22;AAAA;BB;C;XXXX;YY;Z

I'm sure its a simple solution, but I can't seem to find it.

Thanks
User avatar
DV

Post by DV »

The expression you are using is only picking up the '22' part of the line in the search (highlighted in red in the window).

Try - \n22;.*;.*;.*;
User avatar
Lou Meyer

Post by Lou Meyer »

OK That updated the data correctly, but I lost everything after the 4th semi-colon. Sorry if I wasn't clear, but what I need it to replace the data specified, but leave the rest of the record untouched. For example,

Current record 22;aaaa;bb;c;ddddd;fffff;ggggg;hhhh;
Find \n22;.*;.*;.*;
Replace \n22;xxxx;yy;z;
Expected new record 22;xxxx;yy;zz;ddddd;fffff;ggggg;hhhh;
Post Reply