@freshenstein said in Delete everything after the twelth character in a line with other lines of text that need to be left alone:
Is there a way to add to this code that tells it to only look for lines that start with “thing”+number and then delete everything after 12 characters?
Possibly as long as the number is a consistent length, you would change your formula to something like ^(thing \d{6}). Doing it this way you need to limit to an exact character count, so the number must ALWAYS be 6 characters long.
Alternatively something like ^(thing \d+) will work. So it works up until the end of the number. This could be 12 characters, or more or less. The \d+ means as many digits that are together, but must be at least 1.
Terry
PS understand I’m only editing the first part of your regular expression. It’s up to you to add in the “rest of the line” or whatever else you intend to do.