• 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: File name search & replace question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File name search & replace question


  • Subject: Re: File name search & replace question
  • From: Emmanuel <email@hidden>
  • Date: Thu, 24 Oct 2002 22:38:08 +0200

At 12:56 PM -0400 23/10/02, Rips Ethan J wrote:
I. Background:

[...]

II. The question (bet you thought I'd never get around to it):

Has anyone got any ideas on the most efficient way to do the search & replace
functions in the filenames prior to accessing the contents of each file for
insertion into a BBEdit file? Are there better ways of going about this?

The most efficient way may be to use the "Enhanced Find Dialog" for Smile (assuming you're using OSX).

(If you're not, there is a goodie for OS9 named "Renamer" which performs the same thing).

The "Enhanced Find Dialog" provides Regular Expressions, which are able to make sophisticated text changes as you need to. A menu lets you choose to apply any given change either to a text window (so that you can test, say if you've first copied a sample of file names into the window) or to the names of the files you've first selected in Finder.

You could change "385SOI1.txt" into "SOI3851.txt" so that the alphabetical order will sort the files by type. (I'm not sure I understood everything about the "1", "2" which are appended sometimes).

About counting, you may also want to use the "Count" feature of that same dialog.

If this can help, I made your list:

{"385SOI1.txt", "385SOI2.txt", "385SOA.txt",
"385SOCR.txt", "385SOAL.txt", "385SOO.txt", "385SOC1.txt", "385SOC2.txt",
"385CFIA.txt", "385CFIB.txt", "385CFIC.txt", "385CFIR.txt", "385CFIT.txt"}

into:

{"SOI3851.txt", "SOI3852.txt", "SOA385.txt", "SOCR385.txt", "SOAL385.txt", "SOO385.txt", "SOC3851.txt", "SOC3852.txt", "CFIA385.txt", "CFIB385.txt", "CFIC385.txt", "CFIR385.txt", "CFIT385.txt"}

by changing:

([0-9]{3})([A-Z]{3,4})([0-9]?)

into:

\2\1\3

Smile and the Enhanced Find Dialog for Smile are available for free at:
<http://www.satimage-software.com>

Emmanuel
<netiquette> from Satimage, the authors of Smile </netiquette>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >File name search & replace question (From: "Rips Ethan J" <email@hidden>)

  • Prev by Date: Fwd: Re: Applescript reply
  • Next by Date: Blank dictionary window?
  • Previous by thread: File name search & replace question
  • Next by thread: Re: File name search & replace question
  • Index(es):
    • Date
    • Thread