Thanks for all the helpful replies.

I was able to solve this using a combination of ucp and
using wildcards in the rename function for the problem characters.
However, I also came up with a translate table to replace these characters
with their unaccented equivalents, as Gosi suggested, if anyone is
interested.

Also, while I do not see the usefulness of replacing " " by "_", I was
reminded that the names have a lot of " - " separators that can be
shortened to "-" - this also helped.

I didn't try the MoveFile solution Oleg suggested but maybe this will
encourage me to get Package Manager and install the JAL.

A better-designed DVD specification would, of course, have made all
this work unnecessary, but that's the state-of-the-art in technology today.

On 4/21/07, Björn Helgason <[EMAIL PROTECTED]> wrote:

NB. forgot to add that the utility dir is required

   require'dir'

NB. While at changing filenames I recommend renaming spaces away too like:

   (' ';'_')stringreplace 'file name with spaces'
file_name_with_spaces


2007/4/21, Björn Helgason <[EMAIL PROTECTED]>:
>
> NB. What you could do is use
> a=.1 dir 'foldername'
> NB, and/or
> b=.0 dir 'foldername'
>
> NB. use stringreplace to get a name without the chars you do not want in
> the name like:
>
>    require'strings'
>    ('ö';'o')stringreplace 'Höhepunkte'
> Hohepunkte
>
> NB. do that over all the names in the dir results and use ucp for the
> shell operation
> NB. something like
>
> require 'task misc'
>
> rename_files=: 3 : 0
> c=.   ('ö';'o')stringreplace y
> shell ucp 'ren ',y,' ',c
> )
>
> rename_files each a
>
>
> 2007/4/20, Devon McCormick < [EMAIL PROTECTED]>:
> >
> > Members of the forum -
> >
> > maybe someone can give me some direction on a problem I'm having with
> > non-English (two-byte)
> > characters in file names.  When I tried to back up music files onto a
> > DVD, I
> > discovered that the DVD
> > format 1) restricts names to be no longer than 106
> > characters, and 2) allows only a restricted character
> > set.
> >
> > So, if I have a file called "Giusepe Verdi - Höhepunkte aus Rigoletto
-
> > 07.mp3" - where the second letter
> > of "Höhepunkte" is "o diaeresis" (two little dots over the letter "o")
> > and I
> > want to rename it to remove the
> > character I can't write to my DVD.  I have a rename routine that works
> > for
> > files with a few single-byte
> > disallowed characters (like ";:?<>" et al.).
> >
> > However, it works by creating a batch file full of rename commands,
e.g.
> > lines like 'ren "Giusepe Verdi -
> > Höhepunkte aus Rigoletto - 07.mp3" "Giusepe Verdi - Hhepunkte aus
> > Rigoletto
> > - 07.mp3"',
> > but these lines get messed up when they are written to the file.  I
> > probably
> > can't convey exactly
> > how "Höhepunkte" gets mangled as I expect the characters will get
messed
> > up
> > in this e-mail but the
> > second letter shows up as a pair of (odd) letters in the batch file.
> >
> > I found a file rename API in "sflfile.ijs" but this fares no better:
it
> > returns an error code, e.g.
> >    file_rename_jsfl_ 'Giusepe Verdi - Höhepunkte aus Rigoletto -
> > 07.mp3';'Giusepe
> > Verdi - Hhepunkte aus Rigoletto - 07.mp3'
> >
> >
+--+--------------------------------------------------+------------------------------------------------+
> > |_1|Giusepe Verdi - Höhepunkte aus Rigoletto - 07.mp3|Giusepe Verdi -
> > Hhepunkte aus Rigoletto - 07.mp3|
> >
> >
+--+--------------------------------------------------+------------------------------------------------+
> >
> > Thanks for any ideas you have...
> >
> > --
> > Devon McCormick, CFA
> > ^me^ at acm.
> > org is my
> > preferred e-mail
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
>
> --
> Björn Helgason, Verkfræðingur
> Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
> 801 Grímsnes ,t-póst: [EMAIL PROTECTED]
> Skype: gosiminn, gsm: +3546985532
> Landslags og skrúðgarðagerð, gröfuþjónusta
> http://groups.google.com/group/J-Programming
>
>
> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari
einfaldleikans
>
> góður kennari getur stigið á tær án þess að glansinn fari af skónum
>           /|_      .-----------------------------------.
>          ,'  .\  /  | Með léttri lund verður        |
>      ,--'    _,'   | Dagurinn í dag                     |
>     /       /       | Enn betri en gærdagurinn  |
>    (   -.  |        `-----------------------------------'
>    |     ) |        (\_ _/)
>   (`-.  '--.)       (='.'=)
>    `. )----'        (")_(")




--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
801 Grímsnes ,t-póst: [EMAIL PROTECTED]
Skype: gosiminn, gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
          /|_      .-----------------------------------.
         ,'  .\  /  | Með léttri lund verður        |
     ,--'    _,'   | Dagurinn í dag                     |
    /       /       | Enn betri en gærdagurinn  |
   (   -.  |        `-----------------------------------'
   |     ) |        (\_ _/)
  (`-.  '--.)       (='.'=)
   `. )----'        (")_(")

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm




--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to