Using Notepad++, how would I insert the character '(' as the first character for each row with values and the characters '),' as the last characters for each row with values?

Using Notepad++, how would I insert the character '(' as the first character for each row with values and the characters '),' as the last characters for each row with values?

for example:

Before:

06,511,S,PAR658,100511,Miami Beach,Owen Parr,222 Arthur Godfrey Rd.,Miami, FL,331401,100006

After
(06,511,S,PAR658,100511,Miami Beach,Owen Parr,222 Arthur Godfrey Rd.,Miami, FL,331401,100006),
zimmer9Asked:
Who is Participating?
 
ZoppoConnect With a Mentor Commented:
Hi zimmer9,

you can use Search and Replace using regular expressions, replacing ^(.+)$ with \(\1\) using Replace All encapsulates each none-empty line with ( and )

Hope that helps,

ZOPPO
0
 
zimmer9Author Commented:
Are you stating that I should go to:

Replace

Find what:   ^(.+)$
Replace with: \(\1\)
0
 
zimmer9Author Commented:
This does put opening and closing parenthesis on each line which is great.

Is it possible to put an opening and

[closing parenthesis followed by a comma] ?

Just thought I'd ask.
0
 
ZoppoCommented:
You can add the comma to the ReplaceWith:

Find what:   ^(.+)$
Replace with: \(\1\),
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.