Menu

Inserting line feeds

2006-12-28
2012-11-13
  • Nobody/Anonymous

    I need to convert a fixed-width data file into a more readable format. There are no line breaks in the original file, and I'd like to insert them after every 100th character - that will allow me to put this file into a columnar format. Any suggestions?

     
    • pshute

      pshute - 2007-01-02

      I just tried using the advanced Search and Replace (^R) to search for (.....) and replace it with \1^M (with regular expressions enabled). It inserted a newline every 5 characters.  Some regular expression tools allow you to specify and expression count, but I think in this case you'd have to put in all 100 dots.  Hopefully it can cope with such a long expression.

       
    • Greg Bullock

      Greg Bullock - 2006-12-29

      Someone may well have a better suggestion, but this one is better than nothing:

      Record a keystroke macro.

      Regards.
      Greg