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
19 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 30

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 30

Expert Comment

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

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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ā€¦
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now