How do I search for and select a repeating phrase in a file.

How do I search for and select a repeating phrase in a file read via Applescript. The file contains details of phone calls submitted to a charity and I want to be able to analyse the types of call taken. The phrase is 'Type of enquiry' and I want to extract the description that follows. I am a beginner at Applescript and have been working my way through Applescript 1-2-3 but cannot find an obvious solution although I have manged to open and read the file! All suggestions gratefully received.

In applescript you can use something like the following:
set {oldTID, my text item delimiters} to {my text item delimiters, "Type of enquiry"}
set dataBits to text items of textToParse
set my text item delimiters to oldTID
the variable dataBits, then, will be a list where every list item is a string that starts with the text following that phrase. 
You could do regular expressions searches as well, but you'd need to download and install the Satimage osax.

Similar Messages

  • Anyone help? I click on buttons within websites and my mac opens new webpages advertising, mac keeper pro or some foreign exchange trading platform. Did i pick something hop in a download? how do i search for and get rid of this annoying infiltration?

    Anyone help? I click on buttons within websites and my mac opens new webpages advertising, mac keeper pro or some foreign exchange trading platform. Did i pick something hop in a download? how do i search for and get rid of this annoying infiltration?

    You've installed some form of adware. Take a look here:  http://www.thesafemac.com/arg/

  • How can I search for multiple words (not a phrase, but different words) all at once?

    Hello everyone,
    I have a job that includes looking for many different words in large paragraphs. I would make things much faster for me if - instead of typing in "word 1", and then clearing it, and then typing in "word 2" - but rather, I could somehow search for a few words at once. Is there a way to do this? An add-on? Something built in?
    Thanks for the help.

    Try this add-on [https://addons.mozilla.org/it/firefox/addon/find-all/ Find All]

  • How do I search for and remove empty folders?

    I would love any help. I've spent about 6 hours yesterday looking for a solution for this project...
    PROBLEM:
    I'm trying to organize a 6GB file library of sheet music documents.
    After using Gemini to find and delete duplicate files, I'm left with hundreds of empty folders and files spread across the folders in odd locations.
    How do I find and delete all the empty folders?
    My hope is to remove all the empty folders and then manually reorganize the files.
    This will probably take quite a few hours.
    Here is an example of the mess. The folders currently look something like this:
    Music Library 1 > Kids Songs > Easy > Empty Folder
    Music Library 2 > Kids Songs > Easy > "Ode To Joy.mus" and other files are here
    Music Library 3 > Kids Songs > Intermediate > Intermediate songs files are here
    A better / larger question might be - What is the best way to organize this mess?
    Is there a good file manager for organizing these documents? We run a music school and are trying to set it up for multiple teachers to organize their files and sort by a few different tags like: Difficulty, Genre, Teacher Name, Composer name etc.
    Thank you so much for any help!

    I'm afraid the ability to find empty folders is a wee bit complicated, and quite simply is completely broken in Mavericks. Just because a folder appears to be empty, doesn't mean that it is--if it was ever opened it will have an invisible .DS-Store file inside. For instance, in Snow Leopard if I do a search on the Desktop folder for Kind is Folder, plus Number of Items is less than two, I get two folders, both are empty but one I just created and never opened, and the other I created some time ago and later tossed the contents, which means that it has a .DS-Store file. Both show "No Items" in Icon view. If I modify the Number of Items to "equals 0" only the newly created and unopened folder "empty" shows up. If I try the same thing in Mavericks I get no sensible results at all in any set of search parameters.
    The moderator at Houdah Software reports: "Spotlight on Mavericks reports a value of 1 for "Number of Items" (kMDItemFSNodeCount) for all folders." He says he has reported it as a bug. Evidently it is not yet fixed.
    Francine

  • How can I search for email senders and/or email subject(s)?

    I'm probably not savvy enough to figure this out. When I search, e.g. for "Katie" I get to look at several messages where she is cc'd. I also receive messages from "Katie." How do I search for them? I know they are there because I just sent one to trash the other day. I suspect there are a number of them in trash. The only way I seem to be able to access them is to scroll...and that's a bummer.

    Hello.
    *You can click in the search field in the ThunderBird toolbar.
    *Type the words you are looking for such as email the email address
    *Hit enter or select an auto completion choice
    To narrow search results:
    *Click any year, month or day to show only results from that time. Click the looking glass to zoom out.
    *If you cannot see the timeline, click the timeline icon in the top right corner.
    *Hover over any filter, person, folder, tag, account or mailing list in the left pane to see where in time and on the timeline the messages matching the filter are located.
    To exclude persons, folders or other criteria from search results:
    *Click the unwanted person, tag, etc..
    *Select can't be… from the menu that comes up.
    To reduce results to a particular contact, account or other criterion:
    *Click the desired person, folder, etc..
    *Select must be… from the menu that comes up.
    To filter your search results:
    *Check From Me to see only messages sent from one of your email addresses.
    *Check To Me that include you as a recipient.
    *Check Starred to see only starred messages.
    *Check Attachments to see only messages that include attached files.
    To open any message, click its subject line in search results. To act on multiple messages or see more details, click Open as list at the top of the results list.
    I got this from [http://email.about.com/od/mozillathunderbirdtips/qt/Search_Mail_in_Mozilla_Thunderbird.htm here]. Go ahead and click that link if you need anymore help! Cheers.

  • How do I search for lines with a particular pattern and delete them when a match occurs

    How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string. 

    How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string. 
    Lines in what? And what language are you using to develop with?
    Are the lines in a text file? A RichTextBox? A TextBox? Some other control? A List(Of String)?
    Is there some expectation by you that by providing what you wrote in your question post that the knowledge in your mind about what you are thinking about will mysteriously emanate to anybody reading your post so all of the sudden your knowledge will
    become their knowledge and they will be able to provide you with an answer as they will suddenly understand what you are trying to do? Because that's probably impossible. Most people try providing enough information in a question so anybody, even stupid people
    like me, can understand what they want. Maybe you should try that. As well as selecting an appropriate forum for your question in the future. Usually a question like this is related to programming in a particular language therefore a language forum may be
    a good choice. Or not.
    La vida loca

  • I downloaded some pictures my daughter sent in a file. I named the file ".zip" and now I can't locate it in "My Pictures" How can I search for it?

    How do I search for a file I can't locate?

    { Ctrl + J } to open the Downloads window, then right-click that zip file and use '''Open Containing Folder'''.

  • How do I ask photoshop elements to search for and only add pictures on my computer?

    How do I ask photoshop elements to search for and only add pictures on my computer?

    vbond0071 a écrit:
    Please tell me its a simple fix???
    [email protected]
    My suggestion:
    Read the help file carefully:
    http://helpx.adobe.com/elements-organizer/using/workspaces.html
    Now have a look at the the organizer display layout. Just over the main display panel where thumbnails are shown, there is a drop-down menu to choose the sort order. I assume you are on a recent version of Elements? If you are on PSE12 or 13 you can choose the chronological order (ascending or descending), the filename order, or the import batch. Additionally, if you are viewing an album you can have a manual custom sort.
    My other advice is that before you use the organizer, you take the time to read this help file carefully:
    Elements Organizer Help | Creating and editing catalogs
    The organizer is a very power tool if you understand what it can do and if you don't have misconceptions about how it works. It's a powerful toolset  based on catalogs. It can handle and manage folders and files, but that's not its main purpose. Its ability to manage the information included in the exif metadata of your files and the important information you enter with categories, keywords, captions, notes, ratings or the way you include pictures in albums, creations, stacks or version sets is very powerful.

  • How to search for the selected text with a non-default search engine?

    Hi,
    Before the recent update of the search bar, you could select your "current" search engine, and a search for the selected text (right-click on selection) would use that engine.
    Now, it seems that you can only search for the selected text using the default engine. If that's correct, this is a major step backwards for me. For instance, I can't have Google as my default search engine, and search for a selected text on eBay!
    Or am I missing something?
    Thanks!
    R.

    I find this extension very useful for items selected on web pages. It offers all your search engines with select>right click.
    https://addons.mozilla.org/en-US/firefox/addon/context-search/?src=search

  • I have a iphone 5. How do I search for a event from 2013 under search? I do have "all events" selected

    I have a iphone 5. How do I search for a event from 2013 under search? I do have "all events" selected

    I would check, but I believe I have read that the calendar only lets you search back in the current year. You might find additional information about that in the User Guide. http://manuals.info.apple.com/MANUALS/1000/MA1565/en_US/iphone_user_guide.pdf
    What happens if you go back to a month in 2013, do you see a date with any events in it? I'm not saying the calendar is deleting data, just that you cannot search earlier than the current year.

  • When in i-tunes 11 mac, how do i search for a song as well as a genre at the same time?

    when in i-tunes 11 mac, how do i search for a song as well as a genre at the same time?

    If you mean searching for a song that you already have in your Library, then you can select "Music" first. Then, go across horizontally to Genres and select that; then by using the drop-down menu found under "View" & (of course) select "View Options"-- you will be presented with a limited # of choices to sort by.
    My iTunes 11.0.5 shows 4 parameters to choose from: Title, Artist, Year and Rating. Then you can sort & finally...
    Enjoy,
    mm~

  • How do I search for just a folder with Spotlight

    How do I search for a folder with Spotlight, not a file?  Spotlight is a great tool for finding a file, but often I just want to locat a folder.
    When I find a file, how to I see the path to this file?
    These are probably obvious question for longtime Mac users, but I come from the Windows world.

    Activate the Finder's window. Put the folder name in the search field in the Finder's toolbar. Enter COMMAND-F which should change the Finder's window and give a toolbar above the column headers:
    If you click on the dropdown menu with "Any" you will see this:
    Select the "Folder" entry.

  • How do i search for a photo album when i use the search facility on my iPad or iPhone it will not find photo albums of a given name can anyone help

    how do i search for a photo album when i use the search facility on my iPad or iPhone it will not find photo albums of a given name can anyone help

    Photo albums are not searched by Spotlight Search.  Go to Settings > General > Spotlight Search to see and reorder the available search items.
    For more details, see page 12 of the iPad iOS 5.1 User Guide

  • How do I search for all "missing" tracks within the iTunes database?

    I found the dreaded ! of death, and sadly I verified the tacks indeed are not on my hard drive.
    Is there a way to sort on this tag so that I can see what else might be missing on my hard drive but remains in the database (sort of similar to how you can search for all tracks that have missing artwork)? 

    Thanks.  It works perfectly.
    URL for anyone else in need:  http://dougscripts.com/123

  • How do I search for a specific name of an email sender?

    I'm trying to locate, in the easiest way possible, a name that should have appeared in my inbox... How do I search for a specific name?

    type it in the big box on the toolbar and press enter.

Maybe you are looking for