How to remove space character before some expressi

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

How to remove space character before some expressi

Post by Simple »

Dear Sir,

I try a lot to remove space character before some expression but not success

it's like when you want to remove space before comment,
on this example

Ex:
G0 G90 X10 Y10 ; move x and y to 0 position
X-100 Y100 ;move x and y to touch surface

Text after replace:
G0G90X10Y10; move x and y to 0 position
X-100Y100;move x and y to touch surface


Please help me to make regular expression
Thanks a lot

Best Regards,
Simple
User avatar
DV

Post by DV »

It's a bit tricky and depends on your data, whether you have lots of different line variations or not

For the first line you could use something like:
RegEx: (G[0-9].*) (G[0-9].*) (X[0-9].*) (Y[0-9].*) ;
Replace: $1$2$3$4;

User avatar
Simple

Post by Simple »

Thanks you

but my data have a lot of variations
Post Reply