Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add characters to the end of a string using regex notepad2

Tags:

regex

notepad2

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 the end of each line? For example:

String query = "" 
+ " select column1
+ " , column2
+ " , column3
+ " from table
);
//want to add \n" at the end of each line
like image 271
Ryan Denny Avatar asked Jul 09 '13 16:07

Ryan Denny


2 Answers

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

like image 108
HappyDragon Avatar answered Sep 21 '22 17:09

HappyDragon


Find: (.)$
Replace: \1\\n"

Here's a good regex tutorial.

like image 23
Jeffrey Avatar answered Sep 19 '22 17:09

Jeffrey