Re: Fix filenames with blank spaces...

2023-07-09 Thread David Puente

I tried to explain:
The text now is "Anotación 2019-07-08 151143.png” and I want to remove 
special characters (latin characters as accents) in all the png files 
texts… Consider there are spaces and it’s not needed to remove. Only 
change the accents to non accented words…


Is it clear?

-- Mensaje original --
De "Neil Faiman" 
Para "BBEdit Talk Mailing List" 
Fecha 8/7/23, 17:21:00
Asunto Re: Fix filenames with blank spaces...


On Jul 8, 2023, at 8:39 AM, David Puente  wrote:


 Hi folks,
 I need to find some trick to rename the text:

 

 I need find all the .png names removing spaces and accents... Is there any 
pattern to make it possible? Thanks


It will be much easier for people to help you if you can tell us not just what 
your input looks like, but what you want it to look like after it has been 
transformed. Otherwise, we are just guessing, and are likely to give you a 
solution that doesn’t solve your problem.

Regards,
Neil Faiman

--
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 here. 
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit 
Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/2E26C10E-604F-40D7-8E0B-DF08D346C86B%40faiman.org.


--
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 here. 
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/em612510c7-310f-4384-a876-4a1dd5f12a33%4015366124.com.


Re: Fix filenames with blank spaces...

2023-07-09 Thread Darren Duncan
In my experience, by far the easiest and simplest solution for this arises when 
you just try to find and replace a single instance of a space in urls at a time.


Something like this search/replace pair (I didn't test it):

  (\bhref="[^" ]*) ([^"]*\.png")

  \1_\2

That example is just for spaces, not accents, and replaces the first occurrence 
of a literal space in the url with an underscore.


You can run that with a replace-all op for the first space in each url, and then 
hit replace-all again for each additional space, until it says there aren't any, 
so eg if urls have no more than 3 spaces each then its 3 replace-all.


This works as long as your search/replace is idempotent, you are replacing with 
something different than what you're replacing.


As for accents, you can deal with those with a similar process.

-- Darren

On 2023-07-09 1:52 p.m., Roland Küffner wrote:
You might have a hard time figuring out a pattern for this (as I guess that the 
amount of white space in the file names might differ and the file names may not 
follow a strict structure). You could write a script for the task. Or – if it 
was a one-shot-task – I would do the following steps:


1. Search for: href="(.+?)" replace with   \1    (using Grep): choose 
"Extract" – this gives you a new file with all href-Strings in it

2. In the new file: Copy all text
3. Replace all whitespace with _ (an underscore)
3. (for Accents and other stuff add additionals search-replace steps here)
4. Add a tab to each line (you could use the "Prefix/Suffix" command in the 
"Text" menu for that
5. Mark the column left of the tab ("column zeor") with a rectangular selection 
(check the manual if you don't know how to do this)

6. Paste the copied text

Now you have a file with the structure

Save this file and use it as a ad-hoc batch-search-replace source on your 
orignal file: To do this, choose "Text" > "Canonize …". with your generated file 
as a source.


That might just take a few minutes and may be an alternative for getting a 
script right – if you have a lot of different files to process, a script 
solution may be the wiser choice.


Roland



On Sat, Jul 8, 2023 at 4:03 PM David Puente wrote:

Hi folks,
I need to find some trick to rename the text:

     

I need find all the .png names removing spaces and accents... Is there any
pattern to make it possible? Thanks


--
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 here. 
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/67c4128c-a894-f276-b65b-04096f4bb649%40darrenduncan.net.


Re: Fix filenames with blank spaces...

2023-07-09 Thread Roland Küffner
You might have a hard time figuring out a pattern for this (as I guess that
the amount of white space in the file names might differ and the file names
may not follow a strict structure). You could write a script for the task.
Or – if it was a one-shot-task – I would do the following steps:

1. Search for: href="(.+?)" replace with   \1(using Grep): choose
"Extract" – this gives you a new file with all href-Strings in it
2. In the new file: Copy all text
3. Replace all whitespace with _ (an underscore)
3. (for Accents and other stuff add additionals search-replace steps here)
4. Add a tab to each line (you could use the "Prefix/Suffix" command in the
"Text" menu for that
5. Mark the column left of the tab ("column zeor") with a rectangular
selection (check the manual if you don't know how to do this)
6. Paste the copied text

Now you have a file with the structure

Save this file and use it as a ad-hoc batch-search-replace source on your
orignal file: To do this, choose "Text" > "Canonize …". with your generated
file as a source.

That might just take a few minutes and may be an alternative for getting a
script right – if you have a lot of different files to process, a script
solution may be the wiser choice.

Roland



On Sat, Jul 8, 2023 at 4:03 PM David Puente  wrote:

> Hi folks,
> I need to find some trick to rename the text:
>
>  identifier="g989516e6a95da788733f48e98192a620"
> href="web_resources/Anotación 2019-07-08 151143.png">
>
> I need find all the .png names removing spaces and accents... Is there any
> pattern to make it possible? Thanks
>
> --
> 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 here. Follow @bbedit on Twitter: <
> https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bbedit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/6a83df15-0871-402a-8e0a-ce2995da0f3en%40googlegroups.com
> 
> .
>

-- 
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 here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/CABybPXZK0nG4hLZDfA%2ByPBP%2BdmbxgZRVDFR%2BCaB9f7xwKhDYgQ%40mail.gmail.com.


Re: Fix filenames with blank spaces...

2023-07-08 Thread Neil Faiman
On Jul 8, 2023, at 8:39 AM, David Puente  wrote:
> 
> Hi folks, 
> I need to find some trick to rename the text:
> 
>  identifier="g989516e6a95da788733f48e98192a620" href="web_resources/Anotación 
> 2019-07-08 151143.png">
> 
> I need find all the .png names removing spaces and accents... Is there any 
> pattern to make it possible? Thanks

It will be much easier for people to help you if you can tell us not just what 
your input looks like, but what you want it to look like after it has been 
transformed. Otherwise, we are just guessing, and are likely to give you a 
solution that doesn’t solve your problem.

Regards,
Neil Faiman

-- 
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 here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/2E26C10E-604F-40D7-8E0B-DF08D346C86B%40faiman.org.


Fix filenames with blank spaces...

2023-07-08 Thread David Puente
Hi folks, 
I need to find some trick to rename the text:



I need find all the .png names removing spaces and accents... Is there any 
pattern to make it possible? Thanks

-- 
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 here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/6a83df15-0871-402a-8e0a-ce2995da0f3en%40googlegroups.com.