Community
    • Login

    Wrap at 512 Characters

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 3 Posters 2.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chad NewmanC
      Chad Newman
      last edited by

      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.

      Thanks,
      Chad

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Frank OrellanaF
        Frank Orellana
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • Scott SumnerS
          Scott Sumner @Chad Newman
          last edited by

          @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?

          1 Reply Last reply Reply Quote 0
          • Chad NewmanC
            Chad Newman
            last edited by

            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 ++.

            Scott SumnerS 1 Reply Last reply Reply Quote 0
            • Scott SumnerS
              Scott Sumner @Chad Newman
              last edited by

              @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…

              1 Reply Last reply Reply Quote 1
              • Chad NewmanC
                Chad Newman
                last edited by

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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors