Home > Blockchain >  find line with specific string and move this string to the beginning of the line
find line with specific string and move this string to the beginning of the line

Time:10-04

is there a way to move specific srtring of the line to the beginning of the line with Notepad ?

here's lines:

Chevrolet '96 Corvette COUPE [AP] [2] 
Chevrolet '96 Corvette COUPE [AP] [2] [RM]
Chevrolet '96 Corvette GRAND SPORT [AP] [2] 
Chevrolet '96 Corvette GRAND SPORT [AP] [2] [RM]
Chevrolet Camaro Z28 [AP] [2] 
Chevrolet Camaro Z28 [AP] [2] [RM]
Chevrolet Camaro Z28 30th Anniversary [P] 
Chevrolet Camaro Z28 30th Anniversary [P] [RM]
Chevrolet Corvette '67 427COUPE [3] [US/EU] [A] [4]

here's what I want them to be:

Chevrolet '96 Corvette COUPE [AP] [2] 
[RM] Chevrolet '96 Corvette COUPE [AP] [2]
Chevrolet '96 Corvette GRAND SPORT [AP] [2] 
[RM] Chevrolet '96 Corvette GRAND SPORT [AP] [2]
Chevrolet Camaro Z28 [AP] [2] 
[RM] Chevrolet Camaro Z28 [AP] [2]
Chevrolet Camaro Z28 30th Anniversary [P] 
[RM] Chevrolet Camaro Z28 30th Anniversary [P]
Chevrolet Corvette '67 427COUPE [3] [US/EU] [A] [4]

CodePudding user response:

Is [RM] the only substring you want to move to the beginning of the line? In that case do the following: Open the replace window with Ctrl h then select "Regular expression" under "Search Mode".

Then search for the following:

(.*?)\[RM]

And replace it with the following:

\[RM] \1
  • Related