• 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: What is the most efficient/fastest Find & Replace technique?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the most efficient/fastest Find & Replace technique?


  • Subject: Re: What is the most efficient/fastest Find & Replace technique?
  • From: David Hood <email@hidden>
  • Date: Fri, 31 Jan 2003 19:54:48 +1300

Don't forget "tr" on the command line
I've used it for doing batch find/replaces on folders on text files, turning millions of tab marks to line endings.

tell application "Finder"
set NotTabbed to make new folder at desktop with properties {name:"NoTabs"}
set PosNoTab to POSIX path of (NotTabbed as alias)
set Startfolder to choose folder
set ListofTabbed to every document file of Startfolder
end tell
repeat with loopCount from 1 to number of items in ListofTabbed
set tabbedFile to item loopCount in ListofTabbed
set sameName to name of tabbedFile
set butcherME to POSIX path of (tabbedFile as alias)
set command to "tr '\\11' '\\015' <" & butcherME & " > " & PosNoTab & sameName
tell application "Terminal"
do shell script command
end tell
end repeat

The full details of that project are at
http://www.otago.ac.nz/nzpg/caversham/files/CTP260402.pdf

Regards,
David hood
_______________________________________________
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.

  • Follow-Ups:
    • Re: What is the most efficient/fastest Find & Replace technique?
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: What is the most efficient/fastest Find & Replace technique? (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: What is the most efficient/fastest Find & Replace technique?
  • Next by Date: Re: What is the most efficient/fastest Find & Replace technique?
  • Previous by thread: Re: What is the most efficient/fastest Find & Replace technique?
  • Next by thread: Re: What is the most efficient/fastest Find & Replace technique?
  • Index(es):
    • Date
    • Thread