Hey Guys,
Miss me?
Here's the question: Can notepad++ run through a file and convert all occurrences of double line break into single line break? If so, how? If not, are y'all aware of other software that can?
Best,
A.
Hey Guys,
Miss me?
Here's the question: Can notepad++ run through a file and convert all occurrences of double line break into single line break? If so, how? If not, are y'all aware of other software that can?
Best,
A.
What you do is from the search menu, choose replace. Then in the dialog box check only the extended option. In the search field use:
\r\n\r\n
in the replace field use:
\r\n
then click replace all.
That's for carriage return (\r) linefeed (\n) (in windows). If you have a MAC I think it's \r\r replace with \r, but it might be \n\n replace with \n. Unix may be one of those as well. You can tell by first doing a search to see if there are any of those available in the file. Even if you are in Windows, if the file originated on another OS (other than windows) you might need to use their method. And visa versa, say if you are on a MAC editing a Windows file.
If there are triple or quadruple, etc. line breaks that you also want to eliminate, you will have to run it two or more times.
Last edited by jscheuer1; 08-07-2017 at 05:17 PM. Reason: correction
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Suggestion makes perfect sense. Unfortunately, it does not work. (I tried to paste a screen image, but was unable to. I can send the image to you as a pdf file or as an xlsx file if you tell me where to send it.)
A.
Well it worked here, so unless you didn't have the extended option checked, or didn't use the search terms and the replace terms I supplied, I don't know what to say. What kind of file are you trying to edit? You could always put a screen shot up on one of your sites and post a link to it here.
Oh, it just occurred to me, maybe you have spaces or tabs on the empty lines. Then you would need a regex, and I haven't figured out how those work in Notepad++ yet. I'll have another look now.
OK, just looked into regex on my Notepad++, it doesn't appear to span lines no matter what settings one uses and doesn't recognize ^$ as representing an empty line. So it's unlikely it can be used for this.
Last edited by jscheuer1; 08-08-2017 at 02:21 PM. Reason: add info
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
OK, this should work, assuming your Notepad++ is like mine and that there's nothing else going on that's odd. First backup the file just in case. Next do a regular expression wraparound replace on:
^\s+$
That's a beginning of a line followed by one or more white space characters followed by the end of the line. Replace them with nothing (blank in the replace field).
Then (keeping wraparound on) switch to the extended option and replace: \r\n\r\n with \r\n or whatever (as noted previously if the file is in MAC or UNIX format it might be \r\r with \r or \n\n with \n).
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
John,
Thank you for the time you are spending on this.
Here are three links to screen shots you suggested:
https://www.njexpungements.com/screenshot1.xlsx
https://www.njexpungements.com/screenshot2.xlsx
https://www.njexpungements.com/screenshot3.xlsx
A.
OK, the 3rd image is right but I think you must have misunderstood with the other two. Or I explained it poorly. And that part needs to be done correctly first if there is any white space on the blank lines (trailing tabs, spaces, etc.).
When doing the initial wraparound regular expression search, leave the replace field empty. The settings in image 1 and image 2 are the same as far as I can see, and they're both wrong. They should be search on:
^\s+$
and replace with nothing.
Oh, and when you do the extended (like in image 3) leave wraparound on. Other than that, image 3 looks right.
Also, the first two images show files that are already single spaced, at least the parts of them that are visible.
Last edited by jscheuer1; 08-10-2017 at 05:46 PM.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
marain (08-10-2017)
Wow! It worked, finding and replacing 1,832 occurrences. See https://www.njexpungements.com/screenshot1.xlsx. Thank you.
Now the treated file doesn't load properly, but that's a different problem!
A.
Was it working before? Need to know that (if it was, hope you kept that suggested backup). In either case, why not post a detailed question about it in a new thread?
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks