Getting filename from a string including filepath and filename

How I can get a filename from a string which includes both
filepath and filename? The filepath is not always the same. For
example, the variable could include a "C:\temp\test.doc" or
"C:\files\docfiles\test.doc" and I need to get the filename
"test.doc" and save it to another variable. Thanks in
advance.

on getFilenameFromPath vPath
oldDelim=the itemDelimiter
the itemDelimiter=the last char of the moviePath
iFilename=the last item of vPath
the itemDelimiter=oldDelim
return iFilename
end
Put that into a movie script. Then you can call the function
any time
to retrieve the last part of the path- like this:
put getFilenameFromPath("C:\temp\test.doc")
-- "test.doc"
As an added bonus, it is cross-platform so it will work on a
Mac as well
as a PC.

Similar Messages

  • I keep getting calls from a block caller id and it's some dude speaking arabian what do i do? How do i stop this?

    I keep getting calls from a block caller id and it's some dude speaking arabian what do i do? How do i stop this?

    Stop answering calls with blocked numbers. If it's someone who really wants to talk to you, they'll leave you a message and you can call them back.

  • Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

  • I have the new iOS 7 and am getting texts from another family members phone and they are getting mine how do I disable this without changing accounts

    I have the new iOS 7 and am getting texts from another family members phone and they are getting mine how do I disable this without changing accounts

    Welcome to the Apple Community.
    You could simply set each device to only use a single telephone number (settings > messages > send & receive, but this isn't really an ideal solution since the other person can always change their settings and see your messages and send messages that appear as if they are from you. There is only one real solution and that's to have your own accounts.

  • I have the new iOS 7 and am getting texts from another family members phone and they are getting mine how to I disable this ??

    I have the new iOS 7 and am getting texts from another family members phone and they are getting mine how to I disable this ??

    You each need to have separate Apple IDs and separate user accounts. Better yet, separate computers as well.

  • CFpdf and CFcontent shows filepath and filename in browser

    Thanks to all for past help on my CF questions...
    I've developed an upload application for (logged in to secure environment) users that uploads a pdf outside of the root, moves and renames the file and then cfpdf protects the file with a password. Part of the upload process inserts variables in a SQL database such as Catagory, Subcatagory, FileName, etc. The cffile move puts the file inside the root where I have a security framework. No problem with this.
    I have a cfm page populated (dynamically) with links to the pdf files. These links contain url handlers that pass the filepath and filename. When a user clicks a link, he is carried to an index.cfm that has the security framework and within this page I have cfpdf link to the pdf file (and sets a password) and cfcontent loading the pdf file in the browser. All of this works just fine, as it should.
    However... Because cfpdf sets the filepath/filename source and destination and passes this on to the cfcontent tag -- the filepath and filename are shown in the browser address bar as well as naming the download file the same as the http address (albeit with underscores) if the user saves the file. Anyone with any savvy can figure out the actual filepath and filename and go directly to the file in their browser. They'd still have to type in a password to view the file but I'd rather not have this filepath exposed like this.
    Without having to create a copy of the original and rename the file, is there a way to change what is shown in the browser address and in the download filename? At some point there may be many pdf files uploaded and stored on this site. I'd rather not have 2 copies of each file on the server - the original and one renamed...
    I've googled and googled and can't find an answer anywhere on this. Thanks to anyone pointing me in the right direction here.
    - e

    Finally figured this out...
    Since the file exists on the server, there's no need to use cfpdf and cfcontent to serve up the PDF.
    When the PDF link is clicked, the user is directed to a page that has the security framework where there is a redirect to the PDF on the server. I have the PDF password protected. The PDF opens in the browser and, if saved, is saved with the file name only instead of the whole url+filename.
    Learning to work with CF and PDFs through cfdocument and cfpdf lately has been somewhat frustratingly fun.(!) I guess it was overkill in trying to do the above when all I needed was a direct link to the file itself.
    Hope this will help someone else...
    - e

  • I have signed to up to iCloud and am pretty sure that all of my settings are turned on appropriately. However I get syncing from iCloud to my Mac and to my iPhone, but I am unable to get my iPhone to sync with the iCloud and most obviously calendar events

    I have signed to up to iCloud and am pretty sure that all of my settings are turned on appropriately. However I get syncing from iCloud to my iMac and to my iPhone, but I am unable to get my iPhone to sync with the iCloud and most obviously calendar events, so that if adding an event on my iPone it never appears on my other hardware? Can anyone help me sort this out?

    Re: check that the appointments in my phone are going into iCloud calendars....exactly how do I do this?  I fear this is a really stupid question!
    My iCloud account is set up with my Apple ID as one email account (for example [email protected]) which is the email account I use to sign up for internet sites like Amazon, Apple,etc, so that I can differentiate vendors/mass emails.  But my default calendar on my iPhone is in a different email name (ie [email protected]) which I use for most communications to friends, relatives, etc. and it is this account that holds most of my appointments.  To further complicate things I have other email accounts that I use for business/professional and community work.  If I want all my calendars to show on my iPhone AND sync to my iCloud, do I set this at the phone level or the iCloud level?  or both?   
    Let me clarify....It looks like if I go into appointments that I previously set up through my personal account (ie above [email protected]) and edit the entry on my iPhone, selecting the iCloud "home" calendar within the entry, it will then sync to my iCloud account, no problem....do I have to do this to EVERY entry I have? or is there  a way to name my personal account as one to sync to iCloud?

  • I keep getting calls from non existing area codes and phone numbers.  They are never the same number twice.  How do I stop this?

    About a week ago I started getting phone calls on my cell phone from numbers that do not exist, including the area codes.  I can not report these to the Do Not Call list because the area code is non existent.  I'm getting these calls all the time now and never from the same number twice so there's no point in blocking them.  If I answer I may or may not get a person who has an accent from India so heavy that I can't understand what they are saying.  This is getting to the point where I just want to cry I'm so frustrated.  Anyone else having this issue or does anyone know how to stop it?
    Thank you

    I'm sorry that you are having all these troubles. I have sent you a private message.
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • Converting from spreadshet string to array and then back to spreadsheet string

    My questions is; why is the Spreadsheet string to array function creating more data than the original string had when you change the array back into a spreadsheet string. Im trying to analyze a comma delimited file using array functions since my column and row size is constant, but my data varies. Thus my reason for not using string parsing functions which would get more involved and difficult. So, however, after i convert to a 2D array of data from the comma delimited file I read from, and then I convert back to string using the Array to Spreadsheet String, I get added columns to the file, which prevents another program from receiving these files. Also, the data which I am reading is not all contiguous, it has gaps in some places for empty data. Looking at the file compared to the original after it has gone from string to array and then back to string again, looks almost identical except for the file size which got larger by 400 bytes and where the original file has empty spaces, the new file has a lot of commas added. Any idea?
    Charles

    The result you get is normal when the spreadsheet string contains rows of uneven length. Since the array rows have the same number of elements, nil values are added during the coonversion. And of course, the back to string conversion keep those added values in the string, with the associated commas.
    example : 3 x 3 array
    1,2,3
    4
    5,6,7
    is converted into
    1 2 3
    4 0 0
    5 6 7
    then back to
    1,2,3
    4,0,0
    5,6,7
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How to get photos from txt msgs into gallery, and to my home pc

    I have no problem getting photos from Gallery into my home PC (Windows 7) using the USB cord.  I cannot figure out how to save a photo which has been sent to me via txt msg.  tried the bottom left menu, and nothing there to help.

    Try doing a long press directly over photo, see if it brings up a menu of options to do to the attachment/photo. One should be  "Save to storage" or something like that.

  • Get name from Outlook Global Address List and other info

    Hi, I hope somebody can help me. I'm new in Acrobat scripting so I need some more Help.
    I have a link that executes a script that will send an e-mail message.
    This is my script:
    app.mailMsg(true,"[email protected]","[email protected]","","This is the subject","This is the body of the mail.");
    I noticed that when executing this script, Acrobat opened the Outlook Global Address List to verify the e-mail accounts; which is great.
    Now, I'd like to know if there is a command that does this:
    1. (before opening Outlook new message window) Open a window asking for the recipient e-mail address.. with the possibility to get it from the Outlook Global Address Book
    2. Open a second window asking the same as above but putting the e-mail address in the "CC" field.
    2. Finally, the New Message window appears with the "to", "cc", "subject" and "body" fields filled.
    I'd really appreciate your help.
    Also.... is there any other command to get date and hour in a variable?
    Thanks :)

    Hey Cristian,
    I'm interested in your link script. How do you use it? In what program are you and where do you put the actual script?
    Thanks,

  • How to get separators from a string

    I need to find the thousand separator, hundred separator and decimal separator from a string. I need to check which separator is available in a string ie., thousand or hundred separator. There may be a case where there is no separators.
    Please suggest me. I would be greatful if you provide me a code snippet.
    Thanks in advance...

    Hi Ananth,
    Try following:
    //For decimal fraction
    if (Count(Split(StrReverse(ToText ({OINV.DocTotal})), '.') ) > 1) then "With Decimal" else "Without Decimal"
    //For Units
    //Convert numbers to string valule
    //Reverse the string so that you cold parse them accordingly in units, hundreds, thousands etc
    //and finally split and parse each comma
    if
        Length
            Split
                    (Split(StrReverse(ToText ({OINV.DocTotal})), '.')[2]) , ','
                )[1]
        ) <= 2
    ) Then "Hundreds"
    Else "Thousands"
    You can continue on length of each subscript in array for hundreds, thousands, millions...
    Cheers,
    Kashif Ali

  • Ways to get data from the internet with XCode and Objective-C

    Hey guys,
    Thanks in advance for any help. I was simple wondering what the best ways are to get data from the internet to use in an application. For example, is it best to store the data in a MySQL database with PHP and then use C code and MySQL commands to get that data from my Mac app? Is JSON better? Any help would be awesome!
    Josh

    What kind of data are you after?
    Eric

  • Validate filepath and filename

    Hello friends,
    I have a filepath given in the selection screen.  How to check whetehr the file attributes are valid. ie file path and name is a valid one.
    Regards,
    jamshed

    hi John,
      Use FM WS_FILENAME_GET FM...
    i.e,
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_infile.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = p_infile
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Upload File'(078)
           IMPORTING
                filename         = p_infile
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    *START-OF-SELECTION
    START-OF-SELECTION.
      gd_file = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
        IF sy-subrc NE 0.
          write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
          skip.
        endif.

  • How to get folders from your server using IMAP and push, 3G.

    After looking all over this forum looking for an answer, I found out on my own. here's how:
    Step 1: Login to your email server.
    - If you can, log into your email server via webmail. This ensures that you are in fact connected to your email server and your folders are being created. If your email server doesn't have webmail, then create the folders using whatever email app you have on your PC or Mac.
    Step 2: Creating the folders.
    - All the folders you want to have show up on your iphone must be created as sub-folders under your Inbox folder on the server. Here's what mine looks like for example.
    Mailbox
    -Inbox
    ++-Sent Messages
    ++-Deleted Messages
    ++-Friends
    ++-Work
    ++-Others
    -Drafts
    -Sent
    -Deleted
    -Junk Email
    *you may be wondering why I have 2 sent and Deleted folders. I have it set up so that the folders in the inbox are for the iphone, and the ones outside are from Outlook.
    Step 3: Getting the folders to show up on the iphone.
    - Once you set up your IMAP account on the iphone 3g, simply log into the account, wait for it to finish checking for emails, then tap the Inbox button. Give it a few seconds to load if it's loading something. After it finishes, back out by tapping the 'Mailboxes' in the top-left corner, and your folders should be there.

    So you'd use Java to send the WebDAV protocol. Since this is a Java forum, it would help if you provided the WebDAV part of the equation and we can help with the Java part. Okay? Let us know when you have the WebDAV information.

Maybe you are looking for

  • Null values from DB2 cause problems

    Hi, I have another problem with database link to DB2 using IBM iSeries Access for Linux on 64 bit OEL5 with Oracle Database gateway and unixODBC 2.2.14. DB link works. However, null values from DB2 cause problems. Date columns that are null on db2 re

  • Where do I find the UI Scaling option in Photoshop CC 2014?

    I have a Companion Cintiq running Win 8.1..I am a new PS user..After searching for an answer to the tiny and unreadable text and icons on my screen and not being able to enlarge them (no, the display fix inside Windows doesn't do it), I basically fou

  • Sync so slow and deleted my applications. Help!

    guys, i got iphone from my friend and he told me to put images and videos in it, so i downloaded the iTunes, the latest, and i connect iphone to pc, btw~ its iphone(original), then the sync of files begins, it took so long, i think 60-90 minutes, i d

  • Replication of a database

    Do I need to make servers for each master sites of the database, when I want to replicate a data to multi-master sites? I want to replicate the data(some tables) in order to make query and reports from the replicated data. Suppose I have the database

  • Considering Small Business move from Microsoft to Apple - desire feedback

    I am considering migrating my organization of 130 users from the Microsoft stack (Server 2003/2008 with XP workstations) to Apple. I am interested on real world feedback on the following issues: (1) What online resources are there for planning a stag