Author Topic: line length  (Read 298 times)

ehersh

  • New Community Member
  • Posts: 1
  • Hero Points: 0
line length
« on: August 04, 2017, 07:55:12 pm »
Hello, we currently have to find bad characters in certain files by scrolling down the right side of the file, look for any CR/LF out of alignment and correct. Is there anyway to set up slick edit to list all of the lines longer than say 1690? Once we go to the correct line it is an easy matter to find the issue and correct.

Graeme

  • Senior Community Member
  • Posts: 1978
  • Hero Points: 226
Re: line length
« Reply #1 on: August 04, 2017, 11:29:36 pm »
This macro takes you to the longest line in the file
https://community.slickedit.com/index.php/topic,15130.msg57461.html

The macro below scans forward from the current line until it finds a line longer than an entered value.  It's not exactly what you want but you can probably hack it around if you want.

Code: [Select]
#include "slick.sh"
_command void mll() name_info(',')
{
   _str maxl;
   if ( get_string(maxl, 'enter max length') ) {
      return;
   }
   int mm = (int)maxl;
   for ( ;; ) {
      if ( down() ) {
         return;
      }
      end_line();
      if ( p_col > mm ) {
         return;
      }
   }
}