[TxMt] Re: quick way to find longest line in file?

Hans-Jörg Bibiko bibiko at shh.mpg.de
Fri Jan 29 06:28:18 UTC 2016


>>> I'm sure there must be a way to delete trailing blanks from all lines -- could you tell me how or point me to the relevant information.

Create a new Command; input: selection or text; output: discard

Command:

#!/bin/sh
open txmt://open?line=`nl -nrz -w9 -b a|perl -pe 's/^\s+//g'| awk '{print length, $0}'|sort -nr|head -1|awk '{print $2}'`


--Hans


More information about the textmate mailing list