Re: Get and substitute filenames of filepathes that contain umlauts/special chars

"[email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
[email protected],
I did understand your code and still changed some commands before 
(regarding "." and "\.").
Thanks for clarifying the difference between "h" and "H".

I downloaded your file and did a simple test with the "y" command.
UnxUtils sed v407 is available here (check UnxUpdates):
http://www.weihenstephan.de/~syring/win32/

Indeed and in comparison with your version,
it's not possible to use dec or hex values either on the LHS or RHS
with UnxUtils sed 407 using the "y" command.
This seems to be a "bug" I never discovered before.
Your code works as expected with the version you use.
With UnxUtils sed your code must be changed (regarding the "y" command).

Snip:
;s/[ÄÜÖ]/\0e/g ;s/ß/ss/g ;y/ÄÜÖäüö&\d183/AOUauo+-/
(changed a typo mistake LHS "aüö" RHS "aou")
...is much more clever than mine and saves some bytes for length of my 
batch file.

Due to the fact that I'm a frequent user of sed only,
I wonder if one of the two codes provided by you and Thierry has some 
drawbacks?

Thanks very much
Zharif

Am 19.11.2015 um 07:42 schrieb [email protected] [sed-users]:
>
>   Greetings
>
>   Sorry for long silence.
>
>   
>
>
>
>   > Hold buffer: Is "H" and "h" the same?
>
>   No. "h" - replace current hold with pattern. "H" - add pattern to current hold.
>
>   
>
>
>
>   >> Removing the "\d183" on the LHS and the "-" on the RHS of the s-command
>
> It work for me. Checked on sed 4.2.2.93-31c8-dirty - windows binary  https://db.tt/0nXKF049
>
>   Please check commands
>
>   y/\d034\d032\d111/123/
>
>   It must replace quote ("), space  and "o" to 1 2 3 accordnly
>
>   
>
>
>
>   >I simply removed the "y" command but must confess that your code
>
>   >sometimes gave some unexpected results.
>
>   Sorry, i made an error in replacement. I wrote
>
>   s/\x20*.?([-+_.]).?\x20*/\1/g
>
>   Correct string
>
>   s/\x20*\.?([-+_.])\.?\x20*/\1/g
>
>   
>
>
>
>   
>
>
>
>   s/[ÄÜÖ]/\0e/g
>
>   Add "e" to umlauts
>
>
>
>   s/ß/ss/g
>
>   Replace ss
>
>
>
>   y/ÄÜÖäüö&\d183/AOUaou+-/
>
>   Replace umlauts and other symbols with analogues
>
>
>
>   s/([-+_.\x20]){2,}/\1/g
>
>   Remove duplicates of  [-+_.\x20]
>
>
>
>   s/\x20*\.?([-+_.])\.?\x20*/\1/g
>
>   Remove spaces and dots around  [-+_.]
>
>   
>
>
>
>   sed --text -r -e "h;s/.*\\//;s/[ÄÜÖ]/\0e/g;s/ß/ss/g;y/ÄÜÖäüö&\d183/AOUaou+-/;s/([-+_.\x20]){2,}/\1/g;s/\x20*\.?([-+_.])\.?\x20*/\1/g;H;x;s/^/ren \x22/;s/$/\x22/;s/\n/\x22\x20\x22/" "infile" > "outfile"
>
>   
>
>
>
>   Best regards.
>
>   
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
> Posted by: [email protected]
> ------------------------------------
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.