• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: replace / in filename with _
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replace / in filename with _


  • Subject: Re: replace / in filename with _
  • From: Michelle Steiner <email@hidden>
  • Date: Tue, 27 Nov 2001 18:32:43 -0700

On 11/27/01 6:17 PM, kim <email@hidden> wrote:

>I have about 5000 files contained in a whole bunch of nested folders and
>I need to replace a '/' (slash) in their names with an underscore.
>(typically the names are 88/1, 2/87, and I need them to be 88_1, 2_87)

Here's a bit of code to convert the text.

--Michelle

set foo to {"88/1", "2/87"}
set tid to text item delimiters
repeat with counter from 1 to count of foo
set text item delimiters to {"/"}
set bar to item counter of foo
set bar to text items of bar
set text item delimiters to {"_"}
set item counter of foo to bar as text
end repeat
set text item delimiters to tid
foo
--> {"88_1", "2_87"}

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Prev by Date: replace / in filename with _
  • Next by Date: Re: replace / in filename with _
  • Previous by thread: replace / in filename with _
  • Next by thread: Re: replace / in filename with _
  • Index(es):
    • Date
    • Thread