Re: How to put numbers in front of selected lines?

2019-04-11 Thread Christopher Stone
On 04/01/2019, at 09:26, Rod Buchanan mailto:r...@kdsi.com>> wrote: > One problem with -w2 is if the file is >= 100 lines it breaks: Hey Rod, If I remember correctly Bill's original question specified fewer than 100 lines, so that's what I was working with at the time. Mark is on the money

Fwd: How to put numbers in front of selected lines?

2019-04-01 Thread Mark McLeod
I am incredibly rusty at shell scripts, but shouldn’t you be able to use the wc (word count) utility to find the number of lines? If so, the script could use ‘wc -l’ to check the number of lines, and spit its output to ‘wc -m’, which should count the number of characters in that output. Store

Re: How to put numbers in front of selected lines?

2019-04-01 Thread Rod Buchanan
One problem with -w2 is if the file is >= 100 lines it breaks: $ nl -w2 -s'. ' ... 98. 99. 00. 01. 02. $ nl -nrz -w2 -s'. ' ... 98. 99. 00. 01. 02. > On Mar 30, 2019, at 3:04 AM, Christopher Stone > wrote: > > On 03/30/2019, at 02:35, Bill Kochman

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Christopher Stone
On 03/30/2019, at 06:48, @lbutlr mailto:krem...@kreme.com>> wrote: > osxutils looks interesting. Hey Lewis, Thanks for the reminder. I'd forgotten to install those critters. In general they're pretty edge-case commands, but they have their uses. -- Best Regards, Chris -- This is the

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Bill Kochman
Actually, Homebrew is my default go-to choice for Terminal-based installations. However, I figured that MacPorts probably needed an update — which it did — and so then I decided to try to find something with it, which I couldn’t find with Homebrew. As it turned out, what I was looking for — nl

Re: How to put numbers in front of selected lines?

2019-03-30 Thread @lbutlr
On 30 Mar 2019, at 05:37, Bill Kochman wrote: > > Ha! I took it a step further and installed coreutils, moreutils, findutils > and a number of others, via Homebrew and MacPorts. Both? I would pick one (Homebrew) and stick with it. I gave up MacPorts because it required a full install of Xcode

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Bill Kochman
Ha! I took it a step further and installed coreutils, moreutils, findutils and a number of others, via Homebrew and MacPorts. Do you think I overdid it a bit? The way I figure, they take up so little space, I’d rather have them there for the rare occasion when someday some app may need one of

Re: How to put numbers in front of selected lines?

2019-03-30 Thread @lbutlr
On 30 Mar 2019, at 03:37, Christopher Stone wrote: > > `nl` is a part of coreutils. > > Here's a list of them: > https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands And, veering ever so slightly off topic, there is also findutils which gives you access to gnu find and locate

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Bill Kochman
Hello Chris, Ha! Yes, I in fact figured that out and installed coreutils just a bit ago. Thanks for your time! :) Bill Kochman Bill’s Bible Basics wordweaver...@gmail.com https://www.billkochman.com > On Mar 30, 2019, at 7:37 PM, Christopher Stone > wrote: > > On 03/30/2019, at 03:48,

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Christopher Stone
On 03/30/2019, at 03:48, Bill Kochman mailto:wordweaver...@gmail.com>> wrote: > BTW, I tried to install GNU nl via Homebrew, but I was unable to locate it. > In the Terminal, neither “nl” or “gnunl” worked. Likewise, I visited > Homebrew’s formulae page on the web, and I couldn’t[’t locate it

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Bill Kochman
Thanks Chris! The updated script works great! :) BTW, I tried to install GNU nl via Homebrew, but I was unable to locate it. In the Terminal, neither “nl” or “gnunl” worked. Likewise, I visited Homebrew’s formulae page on the web, and I couldn’t[’t locate it there either. I suspect that it

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Christopher Stone
On 03/30/2019, at 02:35, Bill Kochman mailto:wordweaver...@gmail.com>> wrote: > Chris, you wrote: > > #!/usr/bin/env bash > nl -nrz -w2 -s'. ' > > That works on all lines. What about if you have blank lines in the document? > While it works fine on files that have continuous lines of text, the

Re: How to put numbers in front of selected lines?

2019-03-30 Thread Christopher Stone
On 03/28/2019, at 08:25, Rod Buchanan mailto:r...@kdsi.com>> wrote: > Or create a two-line shell script (name it "NumberLines.sh") and put it in > Library/Application Support/BBEdit/Text Filters > > #!/bin/sh > nl -ba -s '. ' Hey Folks, This method is problematic in that it

Re: How to put numbers in front of selected lines?

2019-03-28 Thread Rod Buchanan
Doh! That should be chmod 755 NumberLines.sh > On Mar 28, 2019, at 8:25 AM, Rod Buchanan wrote: > > > Or create a two-line shell script (name it "NumberLines.sh") and put it in > Library/Application Support/BBEdit/Text Filters > > #!/bin/sh > nl -ba -s '. ' > > Make

Re: How to put numbers in front of selected lines?

2019-03-28 Thread Rod Buchanan
Or create a two-line shell script (name it "NumberLines.sh") and put it in Library/Application Support/BBEdit/Text Filters #!/bin/sh nl -ba -s '. ' Make sure it is executable chmod 777 NumberLines.sh Then you can run it like so Text->Apply Text

Re: How to put numbers in front of selected lines?

2019-03-28 Thread Greg Raven
Two easy steps to add the line numbers. 1) Text > Prefix/Suffix Lines … -- prefix each line with ". " 2) Text > Add/Remove Line Numbers … On Tuesday, March 26, 2019 at 5:50:11 AM UTC-7, Vlad Ghitulescu wrote: > > Hello! > > I have a bunch (64 exactly :-) lines selected (copied from an iTunes >

Re: How to put numbers in front of selected lines?

2019-03-27 Thread Vlad Ghitulescu
On 26 Mar 2019, at 14:40, Stephane Gauvin wrote: > whenever I have this kind of (uncommon) task, I copy/paste in a > spreadsheet, do what I have to do, copy/paste back into BBEdit. ! It's so obvious I didn't even think about it! Thanks! -- This is the BBEdit Talk public discussion group.

Re: How to put numbers in front of selected lines?

2019-03-26 Thread Christopher Stone
On 03/26/2019, at 05:36, Vlad Ghitulescu mailto:v...@ghitulescu.de>> wrote: > I have a bunch (64 exactly :-) lines selected (copied from an iTunes playlist > and inserted in BBEdit), like this 5 ones > > Another One Bites The Dust 3:37 > Bicycle Race 3:04 > Bohemian Rhapsody 5:58 > Breakthru

Re: How to put numbers in front of selected lines?

2019-03-26 Thread Stephane Gauvin
whenever I have this kind of (uncommon) task, I copy/paste in a spreadsheet, do what I have to do, copy/paste back into BBEdit. On Tue, Mar 26, 2019 at 9:30 AM Rich Siegel wrote: > On 3/26/19 at 9:27 AM, wordweaver...@gmail.com (Bill Kochman) wrote: > > >Is there a way to use the "Add/Remove

Re: How to put numbers in front of selected lines?

2019-03-26 Thread Rich Siegel
On 3/26/19 at 9:27 AM, wordweaver...@gmail.com (Bill Kochman) wrote: Is there a way to use the "Add/Remove Line Numbers" option to add a period after each number, followed by a space? There is not. However, one could add a step and use a Grep search and replace to change "\d+" into "\0. ".

Re: How to put numbers in front of selected lines?

2019-03-26 Thread Bill Kochman
Rich, Is there a way to use the "Add/Remove Line Numbers" option to add a period after each number, followed by a space? Or would one have to use the "Prefix/Suffix Lines" option first to add the period and space, and then use the "Add/Remove Line Numbers" option to add the actual numbers, but

Re: How to put numbers in front of selected lines?

2019-03-26 Thread Vlad Ghitulescu
Thanks! I thougth this is the line numbering in a file, in the gutter! Thanks again! On 26 Mar 2019, at 14:15, Rich Siegel wrote: On 3/26/19 at 9:08 AM, v...@ghitulescu.de (Vlad Ghitulescu) wrote: Use the line number tool in BBEdit Where is it? Searching for "*line*" or "*number*"

Re: How to put numbers in front of selected lines?

2019-03-26 Thread Vlad Ghitulescu
On 26 Mar 2019, at 14:05, Jan Erik Moström wrote: > Use the line number tool in BBEdit Where is it? Searching for "*line*" or "*number*" doesn't help. -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email

Re: How to put numbers in front of selected lines?

2019-03-26 Thread ThePorgie
There was a post in this group to do this very thing. I can no longer find it to credit the creator. However what he posted was to put this code into a BBedit file: #!/usr/bin/env perl -sw use utf8; $/ = "\n"; my $cntr = 0; while (<>) { print ++$cntr.". "; chomp; print; print

Re: How to put numbers in front of selected lines?

2019-03-26 Thread Jan Erik Moström
On 26 Mar 2019, at 11:36, Vlad Ghitulescu wrote: > How can I do this? Use the line number tool in BBEdit = jem -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "supp...@barebones.com" rather than posting to the group.

How to put numbers in front of selected lines?

2019-03-26 Thread Vlad Ghitulescu
Hello! I have a bunch (64 exactly :-) lines selected (copied from an iTunes playlist and inserted in BBEdit), like this 5 ones Another One Bites The Dust 3:37 Bicycle Race3:04 Bohemian Rhapsody 5:58 Breakthru 4:09 Bring Back That Leroy