Reputation: 41
I have the following list:
32229_071
32225_041
32225_011
32225_011
32225_011
I want it to look like
'32229_071','32225_041','32225_011','32225_011','32225_011'
How do I do this in Notepad++?
Upvotes: 1
Views: 338
Reputation: 91518
(?:^|\G)(.+)(?:(\R)|\z)
'$1'(?2,:)
. matches newline
*Explanation:
(?:^|\G) # non capture group, beginning of line or restart from last match position
(.+) # group 1, 1 or more any character but newline
(?: # non capture group
(\R) # group 2, any kind of linebreak
| # OR
\z # end of file
) # end group
Replacement:
'$1' # content of grop 1 between single quotes
(?2,:) # conditional replace, if group 2 exists then a comma else nothing
Screen capture (before):
Screen capture (after):
Upvotes: 2
Reputation: 345
And replace!
Upvotes: 0