Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The following is an example of characters per line in Notepad ++. I need to limit the characters per line to 14 characters.

11111111111111111111
222222222222222222222222222
33333333333333333333333

I need it to look like the following:

11111111111111
22222222222222
33333333333333

How can I can limit the number of characters to 14 characters per line in Notepad++

share|improve this question
    
Can you please provide more information on the root goal you are trying to accomplish - is this just for editting or will the file be used by another system and need it this way, is it arbitrary characters or specific patterns? –  Eric G Mar 20 at 17:10
1  
If you only need to do it once, take a look at the Column Mode feature notepad-plus-plus.org/features/column-mode-editing.html and just delete the 13 last ones with a few clicks. –  TheUser1024 Mar 20 at 17:13

2 Answers 2

Do a Regex replace.
Replace ^(.{14}).*$ with \1. Keep the . matches newline option unchecked.

share|improve this answer
    
For some reason I have noted that the ^ character doesn't always work in Notepad++, it can't find a regex starting with it. Any idea as to why? –  Kard Nails Mar 21 at 19:33
    
It worked for me with OP's sample data. Can you post your sample on pastebin? –  tumchaaditya Mar 21 at 19:46
    
It was on another similar question, where the OP needed to remove all occurences of literal "\N" on each line except the first. So I suggested he run (\\N.*?)\\N multiple times. It worked, but another user posted this ^(.*?\\N.*?)\\N (when we thought the OP only wanted to remove the second occurence on each line) which did not work for the asker, nor for me. Notepad++ was simply unable to find it. No issues with your redex, though... –  Kard Nails Mar 21 at 20:16

In notepad++ you can use the find and replace function like this : enter image description here

share|improve this answer
1  
You might want to add ^ and & to it just to make it fail safe and OP has mentioned characters. Its not just digits. –  tumchaaditya Mar 20 at 18:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.