Applescript delete certain text?

Hello all. I need some help. I have a mailing list for my business and the way email addresses are entered is like this:
"email","date","ip"
So a quick example would be:
"[email protected]","1268080664","XX.XXX.XXX.XXX"
I don't want to use the online email sender, I want to use one one on my mac. I set up automator to download the text file the info is stored in, but then I need it to delete some necessary functions. Before you ask, "Why not just make your PHP file remove the extra stuff?" and my answer is that I want to keep it there incase I use it in the future. So basically, I am wondering how in applescript, I can have it remove everything but the email address. The email is always laying between the first two quotes, so that might make it easier.
If you can help, thank you very much. If not, can you refer me to where I can get help?

As long as you're sure about the format, text item delimiters are your friend here.
First set the text item delimiters to ". This will logically divide the text into chunks based on each occurrence of the " character. Then just ask for the second 'chunk' (the first 'chunk' will be everything up to the first ", which in this case is an empty string).
set theData to paragraphs of (read file "path:to:your.txt")
set emailAddresses to {} -- somewhere to store the addresses when we're done
set {old_delims, my text item delimiters} to {my text item delimiters, "\""} -- setup the TIDs
repeat with eachLine in theData
  copy text item 2 of eachLine to end of emailAddresses -- extract the email address
end repeat
set my text item delimiters to old_delims -- clean up when we're done
Of course, you don't say what you want to do with the addresses. In this case I just add them to a list emaiAddresses, but you can do whatever you want with them now.

Similar Messages

  • How do i delete an account. I switch from an iPhone and i can't receive certain text

    help

    I swtiched phones and cant recieve certain text. I signed in and hit manage account but cant find where to delete

  • Why this error message with certain texts?

    Why do i get this error message only with certain texts?  I have entered only a ten digit number, have deleted conversations and resent messages and still?

    Oh, the error message is "
    error invalid number please re-send using valid 10 digit mobile number or valid short code."

  • Deleting individual texts and not whole history

    Hi
    How do I delete individual texts from a person and not the whole chat history? This used to be easy on my old bold as each message seemed to be treated seperately whereas on my new curve it's more like a messenger conversation.
    Is it just me being old?
    Thanks
    Ed
    Solved!
    Go to Solution.

    While in a specific conversation, scroll to a certain text message and delete.
    I updated my curve to a new software and the SMS view is different. In order to delete a certain text, I mus view it in my conversation unlike the old software where each text is separated. Rather than in conversations now.

  • Certain Text messages not received by certain iphone users

    hi, i am not receiving certain text messages from certain iphone users. I previously had a iphone 4 and i already turned off the imessage on the phone.

    Hello Justinwong221,
    Have no fear, help is here! I can help with receiving text from iPhone users. I'm glad to see that you have turned off iMessage. The next step is to delete the entire text conversation from your phone and the mobile numbers that you are having issues with and start a new conversation. If the old conversation was originated with iMessage then the issue will not be resolved until the entire thread is deleted on both devices. While this can be tedious, depending on how many iPhone users you know, this is a major step in getting this resolved. Once you have done so then please keep us posted.
    Thank you...
    ArnettH_VZW
    Follow us on Twitter @VZWSupport

  • I deleted a contact out of my iPhone 4S but when I go to send a message the contact appears although that individual is no longer in my address book. I deleted all text and call history pertaining to the deleted contact but still shows up.

    I deleted a contact out of my iPhone 4S but when I go to send a message the contact appears although that individual is no longer in my address book. I deleted all text and call history pertaining to the deleted contact but still shows up. Does anyone have the same issue and how do I fix it?

    dam122577 wrote:
    but wont restoring as new delete all my info on my phone
    Yes. That is why I added...
    it will disappear over time due to non-use.

  • I like to be able to edit and delete individual text messages but since the update only have the functionality to delete a whole conversation

    I would like to be able to delete individual text messages not a whole conversation. With the iOS 7 update this is no longer possible.

    411frustrated wrote:
    I have noticed that with the new IOS 8.1 update when we do this the text messages no longer go back in chronological order.  Do you have this problem?  It is really frustrating me.
    Yes, that's the way it works now.

  • I have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

  • I am unable to delete whole texts from left-swipe. i click delete and they dissappear. But then i can't send or recieve texts. i reboot phone and deleted message reappear. i've synced, backup, everything. Help!

    I am unable to delete whole texts from left-swipe. i click delete and they dissappear. But then i can't send or recieve texts. i reboot phone and deleted message reappear, but i am able to continue send/recieving texts.. i've synced, backup, everything. Help! I am doing this beacuse in my space on my phone my doucments and data are taking up 9GB of space, and i don't know why other than in my phone it says messages are taking up 8GB or so. I am running ios 7.0. I have synced my phone with itunes, backed up, reboots after deleting the texts, they never vanish, i have even restored from itunes and restored from a backup that didn't include the texts after i deleted them.

    actually better to reset your phone and reinstall the latest firmware again after that restore your back up it should be ok

  • I can't delete certain photos in my album with the trash button.

    I can't delete some photos in my album by using the trash button. How do I delete these pictures?

    Sycned my iPad to iTunes and still unable to delete certain photos? Not sure why but trash button does not work on these photos and works fine on others.

  • How can I detect a certain text within a field within CASE using IF

    Dear all,
    for a transformation / generation of values receiving from R/3 into BW I try to
    manupulate three fields. I have a problem detecting a string in a field.
    I am using a CASE with several WHEN clauses on one field. Depending on the
    value, an IF is integrated. There I look into another field evaluating, if it contains
    a certain string. E.g. IF STRING CP 'xyz' OR 'abc'.
    System gives error for the locigal expression. I also tried CS, but same error.
    How can I detect a certain text within a field and which is the right logical
    expression.
    Many thanks in advance!!!
    Claudia

    Hi,
    Folow the blow example...
    May be it helps....
    DATA: hex1 TYPE string,
          hex2 TYPE string.
    hex1 = 'FFFF'.
    hex2 = '123FF'.
    IF hex1 CP hex2.
    ENDIF.
    Cheers,
    SImha.

  • How do I delete some text in a tag in the XML file?

    I need help with removing some text inside the tags so I can use it as a XMLfile
    string example
    Code
    <Event xmlns="http://SwitchKing.Common/Entities/RESTSimplified/2010/07" >
    <Description i:nil="true"/>
    So these are the tags inside the file that is stopping my work. 
    I cant seem to find a way to remove the xmlns.... or the i:nil...
    The i:nil gives of a error when trying to read the file and the xmlns stops the search for other tags in the file.
    So when I have loaded the data I need to delete some text in the tags.
    Help!

    If you want to delete photo stream photos, just deleted them from your device and they will be deleted from iCloud and your other devices.  Be sure you don't want them as you cannot get them back once you delete them.

  • How to delete SMS text from the hard drive of a IPhone 3gs

    How do I delete SMS text from the hard drive of a iPhone 3GS

    If you want to delete the messages from within the text app, swipe over the name or number of the sender and hit delete.
    If you are afraid that someone will be able to restore them by ckecking your HD, you will have to set up the phone "as new device" or choose "erase all content and Settings" in Settings/General/Reset. But this willerase the whole phone, not only your text messages.
    How to set up your iPhone or iPod touch as a new device
    Message was edited by: Ingo2711

  • I have not deleted ANY texts since I got my phone and Ihave not synched.  I just can't scroll back in a thread to older texts.  How can I get back to read those?

    I have not deleted ANY texts since i got my phone 10 weeks ago.   Nor have I syched.  How can I go back to earlier texts in a thread to see them again?

    I've found that the easiest way to view old texts is by archiving them to my computer using a program such as PhoneView (Mac) or TouchCopy (Mac or PC). I generally save important threads to a .pdf for future reference.

  • Cannot delete certain pictures in Iphoto on my IPad. no trash bin option for these particular photos.

    I am having trouble deleting certain pictures on my IPad. They are jpeg pics but by selecting them individually under the photo icon or by using iphoto they will not delete. No trash can icon will highlight to drag them to. I believe there may be dublicate pictures so when I select no trash can appears. I can change to a different date with no dublicate pic and trash can appears. I am doing a backup of my Ipad and maybe I have to go to factory default and start over!!

    How did these pictures get on the iPad?
    If they were synced to it through iTunes on a computer, then the only way to delete them, is to un-sync them the same way.

Maybe you are looking for

  • How can I get a header image to span full width of page?

    Hi All I have tried just about every thing to get this image to span the full width of the page, its fine in design mode but when I view it in preview its centred with white space either side. 

  • Error while accessing HANA-Database

    Hi all, I try to access the HANA-database (installed as secondary database). The table is replicated in HANA and I have created a program in ERP with the following procedure: SELECT * FROM [table]                  CONNECTION ('HANADB')               

  • Error to Define Tax Relevancy Of Master Records

    Hi , I created a condition type ( Y007)  with category as 'D' ( TAX) and  class as 'A'. and then i tried to  Define Tax Relevancy Of Master Records ( Customer taxes) but it gives the message "Condition type Y007 is not defined for taxes" . its fine w

  • Cannot ssh using jsp

    Hi I have a jsp page which contains the shell script for running an instance and then doing ssh to the remote host server .When the jsp page is loaded the instance is run but ssh cannot be done .The ssh to instance takes time (20 to 25 sec ) ,so i tr

  • OBCD for Oracle

    Hi Experts Someone told me in [this|Report can be refreshed in DeskI / WebI but not in InfoView; post that besides my native Oracle client, I need to define an ODBC connection to Oracle in order to be able to connect through InfoView to the source da