1

i have around 900 lines of text in this format: AddTextEntry("TextHere", "TextHere") .. i want to rename these to this format: {model = "TextHere", vehicleName = "TextHere"}, while keeping all of the original text in place which is in this example TextHere.

is this possible? since doing them one by one for 900-1000 lines is a time consuming job. Thanks.

wzrw
  • 13
  • 4

1 Answers1

0

Make a copy of the original file.

Open the original file in Notepad. You can use Sublime Text or another text editor also.

Do find..replace in Notepad by clicking Edit > Replace.

  • In Find what, type this: AddTextEntry("
  • In Replace with, type this: {model = "
  • Click Replace All

That way, you replace AddTextEntry with model.

Go to the top of the file. Do find..replace again.

  • In Find what, type this: ", "
  • In Replace with, type this: vehicleName = "
  • Click Replace All

That way you add vehicleName before the 2nd text.

Go to the top of the file. Do find..replace again.

  • In Find what, type this: ")
  • In Replace with, "}
  • Click Replace All

That way, you change the last close parenthesis with close curly brace.

Review the file. If all looks good, Save the file.

zedfoxus
  • 35,121
  • 5
  • 64
  • 63
  • 1
    thank you very much thats what i'm looking for. i did use `", vehicleName = "` instead of `vehicleName = "` because i needed a comma before the 2nd text. appreciate the help thanks again. – wzrw Dec 12 '21 at 18:45