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  |
  (   -.  |        `-----------------------------------'
  |     ) |        (\_ _/)
 (`-.  '--.)       (='.'=)
  `. )----'        (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to