I have a massive string (a SQL query..) that I have written out in notepad2. I\'m using Java, and I was just wondering if there was a fast and easy way to add something to
Find: (.)$
Replace: \1\\n"
Here's a good regex tutorial.
Maybe something like this
$
- this means "end of line"\\n"
OR simpler
edit
->block
->modify lines
append text to lines
place \n"
In Regex you can group expressions using () - Parenthesis, and represent them as \1, \2, etc. So, anything like this can be appended as follows:
Find: (.*); Replace: \1 your_new_text ;
ctrl+h
make sure regex is on.
find: (.)\r\n
replace: \1 + "\\\n"\r\n
For anyone still here 5 years later, and you are attempting to add something onto the end a line for a large non-code file (and don't want to use REGEX), there are helpful online converter tools like https://pinetools.com/add-text-each-line.
Helped me out a bunch for creating CSV files for a neural network I was making