Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.


Jim Michaels


included are 2 utilities:

  • longestline, a utility that finds the longest line in for each file sopecified and gives a detailed report: the line length, percentage of line number into total file length, line number out of total line numbers.
  • sortlinelength, a linux-style text filter that sorts by line length, and can reverse the order with a command-line switch

What is it useful for?

  • finding out which files in your filesystem violate the MAX_PATH or MAXPATH 260 character filepath length, and extracting lists of the longest files past a certain number of characters.
  • just sorting files by line length
  • finding out which line in a file has the longest line, and approximately what position that is in regards to the whole file - for "eyeballing it" if you want...
  • for fun and enjoyment maybe
  • might have other useful uses of which I am not aware
  • code usage in text editors (well, it's practically built in except for sort by line length)



longestline - find longest lines in specified files and line numbers
usage: longestline filepath [filepath]
       longestline [options]
  [-[-]h[elp]|/h[elp]|-[-]?|/?] this help.
  [-[-]v[er[sion]]|/v[er[sion]]] tgives version number and exits.

For filepaths which have spaces, you should use double quotes " around the filepath. 
this will prevent the spaces from being interpreted as separate arguments.
The filepath, line number of longest line, and number of characters will be reported 
for each file.
Copyright 2012 Jim Michaels. Under GPL3 License.


sortlinelength - UNIX style text filter to sort lines by line length
       sortlinelength [options]
  [-[-]h[elp]|/h[elp]|-[-]?|/?] this help.
  [-[-]v[er[sion]]|/v[er[sion]]] tgives version number and exits.
  [-[-]d[esc[ending[-order]]]|/d[esc[ending[-order]]]] sorts in descending order 
(longer lines first).

Default is ascending order, which is the smallest number of characters per line first.
Copyright 2012 Jim Michaels. Under GPL3 License.


longestline (the name of the package) is under the GPL3 License.