Solved

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?

Posted on 2016-11-17
4
55 Views
Last Modified: 2016-11-17
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),
0
Comment
Question by:zimmer9
  • 2
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 500 total points
ID: 41891750
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
 

Author Comment

by:zimmer9
ID: 41891800
Are you stating that I should go to:

Replace

Find what:   ^(.+)$
Replace with: \(\1\)
0
 

Author Comment

by:zimmer9
ID: 41891817
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
 
LVL 31

Expert Comment

by:Zoppo
ID: 41892533
You can add the comma to the ReplaceWith:

Find what:   ^(.+)$
Replace with: \(\1\),
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question