Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-14 Thread Christopher Stone
On 01/14/2019, at 12:32, ThePorgie mailto:thepo...@gmail.com>> wrote: > Using the double space leaves two spaces intact after a sentence if desired. Hey There, Nicely done!  Here's another way to write that that makes it easy to read: (?https://www.twitter.com/bbedit> --- You received this

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-14 Thread ThePorgie
The word boundary markers you used didn't work for me. I had to switch to "\b". When testing with \b punctuation seemed to mess up my test string. I switched to (? > On 12 Jan 2019, at 18:32, Dj > wrote: > > I'm trying to replace spaces between words so a sentence like this: > > > > "this

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-14 Thread Bruce Linde
ok... pardon my ignorance but why/when does one want leading spaces from a file? On Monday, January 14, 2019 at 9:26:47 AM UTC-8, Lewis Butler wrote: > > On 14 Jan 2019, at 10:15, Bruce Linde > > wrote: > > why do we care about word boundaries? > > Possibly because you do not want to

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-14 Thread @lbutlr
On 14 Jan 2019, at 10:15, Bruce Linde wrote: > why do we care about word boundaries? Possibly because you do not want to strip leading spaces from the file? -- I gotta straighten my face This mellow-thighed chick just put my spine out of place -- This is the BBEdit Talk public discussion

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-14 Thread Bruce Linde
why do we care about word boundaries? and, marek did provide a bbedit-specific solution above... which is the one i use all the time. search for: xx+ (where the x's are spaces... meaning 'find two or more spaces') replace with: x (a single space) i suppose you could just search for

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-14 Thread @lbutlr
On 12 Jan 2019, at 18:32, Dj wrote: > I'm trying to replace spaces between words so a sentence like this: > > "this line has really messed upspacing” It doesn’t look to me like this was actually answered. All the replace multiple space will replace ALL multiple

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-13 Thread Christopher Stone
On 01/13/2019, at 03:06, Marek Stepanek mailto:ms...@podiuminternational.org>> wrote: > I did not know \h = horizontal white space. And it is even working with > BBEdit. Is it mentioned in the User Manual BBEdit? Suggesting a little > correction: Hey Marek, Then you'll want to contact

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-13 Thread Dj
Hello, Thanks for the helpful pointers. I had at it for a few *hours* with regular expressions and in the search results it looked like there were some lines that shouldn't be in there. Seemed like I had it close to right, but I didn't want to delete anything accidentaly. So next (after

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-13 Thread Marek Stepanek
I did not know \h = horizontal white space. And it is even working with BBEdit. Is it mentioned in the User Manual BBEdit? Suggesting a little correction: Your search and replace is not doing what Dj was asking for: replace + with : > s/\h+/ /g; 1. Replaces *one* or with one space.

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-13 Thread 'Jeffrey Jones' via BBEdit Talk
On 2019 Jan 12, at 20:32, Dj wrote: > > I'm only trying to change space between words and not carriage returns and > all that. So far I've tried placing this in the scripts folder: > perl -pe 's/ +/ /g' Why use perl at all? Since you're using BBEdit, use BBEdit's Find & Replace. Find (grep):

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-13 Thread Oliver Boermans
Hi Dj, To address the shebang issue ensure the first line of your script file includes something like: #!/usr/bin/perl I don’t know the first thing about Perl, fortunately replacing multiple spaces with single spaces is a simple search and replace with grep in BBEdit: Search for (omitting "):

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-13 Thread Christopher Stone
On 01/12/2019, at 19:32, Dj mailto:futurevint...@gmail.com>> wrote: > I'm only trying to change space between words and not carriage returns and > all that. So far I've tried placing this in the scripts folder: > > perl -pe 's/ +/ /g' Hey Dj, The code you have above is the sort of thing that

Re: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-12 Thread Christopher Stone
On 01/12/2019, at 19:32, Dj mailto:futurevint...@gmail.com>> wrote: > I'm only trying to change space between words and not carriage returns and > all that. So far I've tried placing this in the scripts folder: > > perl -pe 's/ +/ /g' Hey Dj, All shell scripts have to have a legitimate

One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-12 Thread Dj
Hello! I'm trying to replace spaces between words so a sentence like this: "this line has really messed upspacing" Looks like this: "This line has really messed up spacing" I'm only trying to change *space between words and not carriage returns and all that.* So