How to get only the filename and extension for a text item?

Suppose there is a non-database text item called :myfilename
:myfilename := 'C:\SomeFolder\SomePath\myfile.doc';
I would like to get the file name only without the full path,
i.e. myfile.doc
and the file extension, i.e. 'doc', 'bat', 'java', 'xhtml' etc., i.e. the last few chars from the right to the period.
Any help is welcome.

Thanks for the hints.
I defined the non-database Text Item called FULLFILENAME and another two text items called FILE_NAME, FILE_EXTENSION. The following can extract the file extension,
select substr(:FULLFILENAME,instr(:FULLFILENAME,'.')+1) into :FILE_EXTENSION from dual;
e.g.
:FULLFILENAME := 'C:\MyFolder\AnotherFolder\file.doc';
FILE_EXTENSION becomes 'doc'
but I would also like to extract only the filename without path into FILE_NAME,
i.e. file.doc
Please give more hints. Thanks.

Similar Messages

  • How can I save ONLY the bookmarks and extensions

    I am about to do a clean reinstall of Firefox. I want to save ONLY the Bookmarks and Extensions and NOTHING ELSE from the Firefox Profile. How can I do this please?
    Thank you,

    Both answers combined to help solve the problem. It would be good if more than one answer can be selected as "Chosen Solutions", because this situation occurs often in forums.
    Thank you to both of you!
    Kind regards.

  • How to know the filename and extension of a file in PKCS7  envelope

    Hi! I've a programm that makes a PKCS7 file. I'm enveloping just one file at a time. I want to know if there is a way to know the filename and extension of the file INSIDE de PKCS7 envelope. Because I receive a file that has .p7 extension, but the real document, the one to be decyprted, I don't know its name nor its extension, and I need both for writing it (I will not just invent some name).
    Best regards!

    The construct of the PKCS7 structure you have, is defined in rfc2633. The part defining EncapsulatedContent is introduced in CMS [rfc2639], where no such attribute for a file name is saved in the structure.
    In some occasions, when it is critical, organizations add own object identifier and attibutes to save such descrptivie information as filename and extension.
    A practical approach is, on the signing side, sign the file A.ext to A-ext.p7m resp. A-ext.p7s
    You can not assume a global approach to get back the original filename (if you have no agreement on not the signing peer as above) of the encapsulated data. The reason is, the encapsulated data field is general and it does not neccesarily mean it was a file (a part of a stream or any definite sequence of bytes in general).

  • Get only the filename not the full path of the file.

    hi to all..
    how can i get only the filename of the file not the full path and to be placed on a textinput.?
    example:
    when i'browse the file and select sample.txt
    "C:\Users\user\Desktop\folders\sample.txt" this will be inputted on the textinput.
    however, what i want to have is when i'browse and select a file..
    textinput should only contain "sample".
    does anyone knows how to do it?

    Hi cyrus@adobe,
    How are you getting the full path of the file when you browse, I dont think for security reasons the Flash Player will aloow to do so. You can only get the file name not the full path of the file when you browse.
    Are you using Flex4..?? I am not sure whether this is possible in Flex4..However if you are getting full path and if you wanted to show only the filename then you can just use theString class split function to acehive this..
    var fullPath:String = "C:\Users\user\Desktop\folders\sample.txt";
        var splitPath:Array = fullPath.split("\");
        textInput.text = splitPath[splitPath.length-1];
    Thanks,
    Bhasker

  • How to get only the first result in extract function

    do you know how to get only the first element of the function extract.
    v_result := p_response.doc.extract('//'||p_name||'/child::text()').getstringval();
    if i have 5 responses like '100','100',100','200','200' e get '100100100200200' and i want only '100'.
    thanks in advance

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • I've tried safe mode but I dont understand what is happening. I tried pressing the power button on and off for several times and nothing happens, I'm always stuck on an apple logo and a spinning wheel. I dont know how to get to the Partition and the DiskU

    I've tried safe mode but I dont understand what is happening. I tried pressing the power button on and off for several times and nothing happens, I'm always stuck on an apple logo and a spinning wheel. I dont know how to get to the Partition and the DiskUtility. The Apple Logo and the Progress Indicator will continue to spin and I have literally no idea what to do. i am in desperate need of help. help me pls

    Turn it off.
    Start it up again and (at the sound of the chime) press and hold the command and the R keys, hold them down until Recovery loads. When it does you will select Disk Utility and you should be on the First Aid tab when it opens, if you are not please select it. Then select the partition (in the side bar, 2nd entry on the list, see picture).
    Yours is probably called Macintosh HD.
    Once you have selected it go to the lower righthand corner of the First Aid dialog and press Repair Disk.
    This will take 10 minutes approximately. Post back when it is finished and tell me what it says.

  • How to get purchase organization,  PAYMENT_TERMS and INCO_TERMS for vendor?

    Dear friends,
    How to get purchase organization,  PAYMENT_TERMS and INCO_TERMS for a vendor(LIFNR)? I couldn't fine these data in LFA1 table.
    Thanks a lot!

    Hi,
    You can find ZTERM(Terms of Payment) in LFB1 table for a particular vendor (LIFNR) and company code.
    and Incoterms INCO1 in LFM1 table for a particular vendor (LIFNR) and purchase organisation.
    Hope this answers your query.
    Regards,
    Brajvir

  • For preparing the filenames and paths for the oracle database files..

    Hi,
    I am preparing the filenames and paths for the oracle database files.....but I am not able to complete this one...Will you Please help for filling this one.
    Controlfile ---- > select name from v$controlfile;
    Redologfile -- > select member from v$logfile;
    Datafile --------- > select tablespace_name,file_name from dba_data_files order by 1;
    Tempfile --------> select tablespace_name,file_name from dba_temp_files;
    Spfile -----------> show parameter spfile
    Pfile --------------->
    Passwordfile ---->
    tnsnames.ora -->
    listener.ora------>
    sqlnet.ora ------>
    oratab ------------->
    Thanks
    Shiju

    orashiju wrote:
    Hi,
    I am preparing the filenames and paths for the oracle database files.....but I am not able to complete this one...Will you Please help for filling this one.
    Controlfile ---- > select name from v$controlfile;
    Redologfile -- > select member from v$logfile;
    Datafile --------- > select tablespace_name,file_name from dba_data_files order by 1;
    Tempfile --------> select tablespace_name,file_name from dba_temp_files;
    Spfile -----------> show parameter spfile
    Pfile --------------->spfile and pfile are located under $ORACLE_HOME/dbs/
    Passwordfile ----> passwordfile is located under $ORACLE_HOME/dbs
    tnsnames.ora -->
    listener.ora------>
    sqlnet.ora ------>all above files are under $ORACLE_HOME/network/admin
    oratab ------------->depends on operating system. Usualy under /etc/oratab

  • HT1904 How do I accept the terms and conditions for iTunes if there is no agree button?

    How do I accept the terms and conditions for iTunes if there is no agree button?  There s nothing at the end of the email. I've tried downloading an app and accepting there but it does the same thing.

    iOS 7.0.3 is now available ,that may have a fix

  • How to get only the first level of nodes for a subform?

    How can we get only the first level of nodes of a subform?
    For ex:
    Form1
         SubForm1
              Text1
              Text2
              RadioButton1
         SubForm2
              Text1
              Text2
              RadioButton1
         SubForm3
              Text1
              Text2
                   SubForm31
                        RadioButton1
    In this heirarchy if we give Form1.nodes will refer to all nodes under the Form1 (SubForm1,Test1,Text2,RadioButton1,SubForm2,...SubForm31, RadioButton1 etc..)
    But is there any way that we can access only the first level of nodes of Form1 ie can we get only (SubForm1,SubForm2,SubForm3) for Form1 in any Way..?
    Thanks.

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • How to get only the selected layer data?

    Hi All,
              I'm using dissolve sample plugin. I added two layers in photoshop both of different dimensions, say 1000 * 1000 & 2000 * 2000. Now I select the layer with 1000 * 1000 dimension and click on Dissolve plugin. The preview image what is shown in dissolve plugin dialog is not just the selected layer, but also some extra pixels around the selected layer.
    Do I need to set any flag for getting only selected layer data to display in preview?
    Also I need to get only the selected area in a particular layer. When I checked FilterRecordPtr, haveMask flag is TRUE if the part of the layer is selected. But how do I get only the part of the layer that is selected for displaying preview image?
    Please let me know if the description is not clear.
    Thanks,
    Dheeraj

    Thanks Tom Ruark for the response.
    That is exactly the same thing what I'm seeing.
    1.Is there a direct way to know the bounds of the layer without the transparency grid so that I can show only the layer?
    2. If I select an area of 50*50 within a layer(1000*1000) using Rectangular Marquee tool, then I want only that selected area to be shown in preview. For this there is a haveMask flag which indicates whether or not there is selection, but the selected bounds are not available. I'm currently calculating the bounds. I just wanted to know if Photoshop SDK has any field for getting the bounds?

  • HT1483 Ipod froze. How to get over the problem and bring it back?

    Ipod froze and not responding. How to get over this problem and bring back the Ipod ?

    Go to the  menu/About This Mac - what OS version shows there?
    Do a backup, preferably 2 separate ones on 2 separate drives.
    Revert to a Previous OS X
    Revert to Snow Leopard
    If you do revert, I'd use Setup Assistant to restore your data. This process takes a while, so do it when you won't need the computer for several hours, based on my experience.

  • XML parsing - NodeList : how to get only the desired childs

    Hi
    my question is about parsing XML files. I use "getChildNodes()" method (from org.w3c.dom.Node class) to get in a NodeList all childs of node. Is there a method to get only desired child nodes? For example I want to get only node elements wtih tag "coordinate". Or alternatively, is there a method to exclude text node to be added to the NodeList? My problem is that depending on the xml is formatted, text node could be recognized and added from parser, and this causes problems with my parsing..
    thanks to all

    If you want to select nodes based on changing criteria, you should use XPath.
    If you have relatively fixed criteria, iterate over the nodes and pick out the ones that you want. For example:
      public static List<Element> getChildren(Element parent, String tagname) {
        List<Element> result = new ArrayList<Element>();
        NodeList children = parent.getChildNodes();
        for (int ii = 0 ; ii < children.getLength() ; ii++) {
          Node child = children.item(ii);
          if ((child.getNodeType() == Node.ELEMENT_NODE) && tagname.equals(child.getNodeName()) {
            result.add((Element)child);
        return result;
      }

  • How to get only the date without the time in the footer of a printout?

    Is there a way to get only the date without the time in the footer of a printout?

    As far as I can tell, there's no built-in option to get the date printed without the time. It's hardcoded in a C++ file.
    As a workaround, you can enter custom text for the footer, but it would need to be updated every time the date changed. I can think of a couple ways to automate that:
    * An add-on (but I'm not aware of any add-on for this)
    * External process to push a new date into prefs.js, a settings file that stores your header/footer preferences, among others (but Firefox should be closed when you update this file, and it will be read when you restart)
    Not easy enough, I know.

  • How to get only the whole number omitting the decimals

    Hi Experts,
    I want to get only the whole number of a output field. For example  i am getting an output as 8.766 , i need only the value 8 .
    I checked by moving the values to integer field but i am getting the rounding value 9 .
    I want only the whole value 8.
    Please help me out..
    thanks & Regards.
    Reena..

    Hi Reena,
    Unfortunately when you assign a packed number to a character, numeric or even a packed no without a decimal value SAP does a internal conversion of rounding these value. So direct assignment would won't work for your case.
    You can use the following logic instead for getting the whole number.
    DATA : LV_VAR1 TYPE STRING,
                LV_VAR2 type p DECIMALS 3 value '8.766'.
    LV_VAR1 = lV_VAR2.   " LV_VAR1 would contain 8.766 without rounding.
    write  : LV_VAR1(1).   " LV_VAR1(1) contains 8 which you can assign to any target variable.
    I think there is no addition so as to avoid this internal rounding.
    Try and let me know if it works for you..
    Cheers
    Ajay

Maybe you are looking for

  • No valid packages error in Disk Utility

    I have been experiencing some problems with my eMac so I thought I would get Disk Utility to check my HD over. First I started by checking Permissions to which I get the following error. Repairing permissions for "Macintosh HD" Error: No valid packag

  • Image rollovers with Spry fade possible?

    Does anyone know of a way to implement the Spry Fade effect so that the result is an image that will fade onmouseover and fade out onmouseout? Ideally I would use .hover, but this is not available, so I have to use onmouseover and onmouseout. The pro

  • Orientation of iPhotos photos in Web Gallery

    Does anyone know why it is that when I upload pictures from my camera to iPhoto, create an event and album, rotate the pictures that are not upright, and then publish the event/album to Web Gallery that the pictures that I rotated in iPhoto are no lo

  • Different G/L a/c depending upon source country

    Dear All When i procure the same material from different country, i expect the system to post to different GL a/c depending upon the country. How to configure this in SAP? Kindly share your experiance.. Thanks and Regards

  • Please help me solve my kernel panics

    I have been having kernel panics almost daily for about 2 weeks and I can't figure out what to do. I have tried repair disk, repair permissions and no luck. I ran software update and everything is updated. Here is my latest panic report. Any help wou