Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • Last Modified:

Using Notepad++, how would you automatically add a "," (comma) to the end of each row (REPLACE command)?

Using Notepad++, how would you automatically add a "," (comma) to the end of each row (REPLACE command)?

For example:

BEFORE:

('05','512','S','PAR659','100512','Gainsville,  Fl','Rick',,1)
('06','612','S','PAR660','100512','Gainsville,  Fl','Fred',,2)

AFTER:

('05','512','S','PAR659','100512','Gainsville,  Fl','Rick',,1),  
('06','612','S','PAR660','100512','Gainsville,  Fl','Fred',,2),
0
zimmer9
Asked:
zimmer9
2 Solutions
 
Ryan ChongCommented:
try this:
-SnapShot.pngand then click the Replace All button.
0
 
sarabandeCommented:
alternatively, you may use the macro recorder.

set the text cursor at begin of list.
start recording.
use keyboard to move to end of line
use keyboard to insert ','
use keyboard to move to begin of line
use keyboard to move to next line below
stop recording
do playback until all lines are done.

Sara
0
 
tliottaCommented:
In the Replace dialog, select Extended as noted by Ryan.

In Find: box, find {\r\n} in order to locate CarriageReturn\NewLine sequences. For Replace, specify {,\r\n}. (Without the braces in both cases.)

You might test by simply clicking 'Find' a few times to verify that the end-of-line is always being found.
1

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now