Wrap at 512 Characters

  • Can I set Notepad ++ to wrap at 512 characters?
    I have a flat file that I’m trying to review and the records are 512 characters long.


  • I would make a search and replace:

    Find What: (.{512})
    Replace with: $1\n
    Regular expression: marked

    then edit what has to be edited and then restore the original file with another replace:
    Find What: \n
    Replace with:
    Regular expression: marked

  • @Chad-Newman

    I think your described scenario is a little vague.

    “Wrap” has a meaning of its own, but I presume, like Frank, that you want to put a line-ending in near column 512 without breaking a word in the middle?

    If that’s what you’re driving at, how about setting the Vertical Edge to 512, then select the text you want to affect, and then performing a Edit (menu) -> Line Operations -> Split Lines operation?

  • Thanks folks.
    I’m not trying to edit the file or change anything in it. I have a data file generated by an application that I’m trying to review.
    It is a flat file with reach record containing 512 characters.
    I would like to be able to review the records and in order to do this, I must have NotePad ++ wrap the text to the next line and new record every 512 characters. You would never end up splitting the word in the middle because the records must end at 512.
    Again, my preference would be not to edit the file and then change it back just to review. Textplorer allow me to wrap at x number of characters, but I would prefer to use NotePad ++.

  • @Chad-Newman

    I think your best option is going to involve changing the file, very much like @Frank-Orellana 's first replacement operation above, which you can record as a macro so it is a one-step kind of action. After visual review of the document, simply close the file without saving the changes made to it by playing the macro. Bam, done…

  • Thanks for everyone’s help. At the end they added crlf to the end of the record. Make it much easier.

Log in to reply