How to extract extension of  file like (jpeg from c:\prashant.jpeg)

hi
please tel me that howa to extract file type  from path of file
like  c:\prashant.jpeg
thanks

use this code....
PARAMETERS: infile LIKE rlgrap-filename OBLIGATORY.
DATA: txt1 TYPE char200,
      txt2 TYPE char4.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR infile.
  PERFORM file_browse.
START-OF-SELECTION.
  SPLIT infile AT '.' INTO txt1 txt2.
  WRITE: txt2.
*&      Form  FILE_BROWSE
*       text
*  -->  p1        text
*  <--  p2        text
FORM file_browse .
  CALL FUNCTION 'F4_FILENAME'
     EXPORTING
       program_name        = syst-cprog
       dynpro_number       = syst-dynnr
*   FIELD_NAME          = ' '
     IMPORTING
       file_name           = infile.
ENDFORM.                    " FILE_BROWSE

Similar Messages

  • How to extract a folder (and its contents) from inside a zip file?

    There is a zip file which contains a folder inside it. The folder itself contains a few files. I would need to know how to extract the folder (with its contents) from inside a zip file.
    I have found a few unzipping code samples which show how to handle a folder inside a zip file. An example is shown below:
    public static void extract(String workingDirectory, byte[] zipFile)
    throws Exception {
    ByteArrayInputStream byteStream = new ByteArrayInputStream(zipFile);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ZipInputStream zipStream = new ZipInputStream(byteStream);
    ZipEntry zipEntry = null;
    String nameZipEntry = null;
    byte[] contentZiphttp://forum.java.sun.com/post!default.jspa?forumID=31#
    Click for code tagsEntry = null;
    boolean isDirectory = false;
    int indexFileSeparator = -1;
    String directory = null;
    String fileName =  null;
    while ( (zipEntry = zipStream.getNextEntry()) != null )
                nameZipEntry = workingDirectory + File.separator + zipEntry.getName();
                isDirectory = zipEntry.isDirectory();
                if (isDirectory) {
    File file = new File(nameZipEntry);
    file.mkdirs();
                else
                    // read zipEntry
                    byte[] buf = new byte[1024];
                    int c = 0;
                    while ( (c = zipStream.read(buf)) != -1)
                        out.write(buf, 0, c);
                    indexFileSeparator = nameZipEntry.lastIndexOf(File.separator);
                    directory = nameZipEntry.substring(0, indexFileSeparator);
                    fileName =  nameZipEntry.substring(indexFileSeparator+1,nameZipEntry.length());
                    FileSystemTools.createFile(directory, fileName, out);
                    out.reset();
                    zipStream.closeEntry();
            zipStream.close();
            byteStream.close();
    }The code sample which deals with the part where the zipEntry is a directory creates a directory with the same path and name. (highlighted in bold)
    Another similar variation is:
    File file = new File(dirDestiny.getAbsolutePath() + File.separator + zipEntry.getName() );
    if(zipEntry.isDirectory())
          file.mkdirs();When the code creates a directory for the folder, does it unzip the contents inside the folder as well?
    If not, how do I extract the files inside the folder?

    Have you already tried to see if the sample code you downloaded works or not? Maybe if you try out the code yourself you can see if it extracts files from a directory within a zip file?
    I like to use pkzip. It is a command line compression/uncompression tool that can be used from a batch file. If you assignment involves unzipping large amount of zip files on a regular basis, I recommend taking a look at pkzip.

  • How to extract a PAR File

    Hi All,
    In the procedure of changing the Portal Logon / Logoff page ,we need to extract Par file ,modify the extracted files and then put them back,can somebody tell me how to extract a PAR file ,wt is the procedure of tat.
    Regards,
    Saumya

    Hi Saumya,
    First you need to retrieve the logon PAR file from the portal file system.The file is found in your EP instance,which is located at ..
    /usr/sap/<instance>/j2ee/j2ee_00/cluster/services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/deployement/pcd
    -The file that you need is called sap.portal.runtime.logon.par.bak.
    copy this file to your local directory and rename the PAR file(for eg. my.new.logon.par).It is necessary to remove the .bak extension.
    -Next you can open the PAR file and modify the appropriate files.
    -put modified files back into PAR file
    -copy the new par file back into the deployement directory
    and restart the portal to see ur changes.
    Also look at the following threads for more info -
    <a href="https://www.sdn.sap.com/irj/sdn/message?messageID=2758339">https://www.sdn.sap.com/irj/sdn/message?messageID=2758339</a>
    <a href="https://www.sdn.sap.com/irj/sdn/message?messageID=2225096">https://www.sdn.sap.com/irj/sdn/message?messageID=2225096</a>
    Regards,
    Abhishek
    (Reward Points if useful)
    Message was edited by:
            Abhishek Mehra

  • How do i make firefox automatically open a file. "Do this automatically with files like this from now on." does NOT work.

    I have firefox set to Open .wav files with VLC and i have the check box marked to "Do this automatically for files like this from now on." But every time i click download for a .wav voicemail from gmail, i get the same dialog box. I just want firefox to hand the downloaded file to VLC and play it. I don't want to have to click anything after i click the download link. Isn't that action what i'm telling firefox to do after i mark the checkbox with "Do this automatically with file like this from now on." ? Isn't that implied with my selection of the box? How can i fix this?i want to click a "download" link for a .wav voice mail in Gmail and have it automatically play in VLC without any further interaction from me.

    No it's saving the preferences and the check box remains checked from session to session. It will even continue to ask me to what to do with the file even in the same session when i try to download the same file again 5 seconds after i downloaded it the first time.

  • How to transfer files like music from mac to ipad? tried it using mac but what happen was opposite!

    how to transfer files like music from mac to ipad? tried it few times but what happen was the opposite.

    If you want to sync your iTunes library on your Mac to your iPad ....
    Connect your iPad to the Mac and launch iTunes. Click on your iPad's name on the left side under the devices heading. Then click on the Music tab - and select the music that you want to transfer. Does your iTunes window look like this - with Sync Music checked and the playlists or albums checked as well like in the photo below?
    When you click on the apps tab do you have Sync Apps checked and all of the apps in the window below checked to sync as well?
    If you select all of the items under the different tabs in iTunes - music, apps, photos. etc. - when you sync - all of the selected content should sync over to the iPad.

  • How to extract the cobol files into owb

    Hi
    How to extract the cobol files in owb,I am using OWB9.2.
    Ex:I am having 2 records DCEC4000100 9159000050C those values are 5 bytes 'RAVI and 6 bytes '15000'.
    Using contorl file i am trying to load these into Oracle,But i am not able into insert these records into Oracle.
    Can any tell me how to handle this kind of situation?
    Regards,
    Rupak

    Good morning Ashok,
    Your data is in a SQL*Loader supported datatype, so basically it should not be a problem.
    Have you checked the Database Utilities guide (for Oracle9i for instance: http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96652/toc.htm) on how to handle this?
    I'll also repeat my previous question, have you ever been able to load data into the database using SQL*Loader (either using ASCII values or any other datatype)?
    For the OWB part, have you read "Importing Data Definitions" (typically chapter 4)? More specifically, "Specifying Field Properties" in "About Flat File Sources and Targets"?
    In "SQL*Loader Properties" it says the following:
    Type Describes the data type of the field for the SQL*Loader. You can use the Flat
    File Sample Wizard to import the following data types: CHAR, DATE, DECIMAL
    EXTERNAL, FLOAT EXTERNAL, INTEGER EXTERNAL, ZONED , AND ZONED
    EXTERNAL. For complete information on SQL*Loader field and data types, refer to
    Oracle9i Utilities. Currently, only portable datatypes are supported.
    If you check the database utitlities guide (chapter 6 Field List Reference) and look for "SQL*Loader Datatypes", you'll find (packed) decimal under the Nonportable Datatypes. This implies that OWB does not support it.
    This does not mean you can't use SQL*Loader, you'll only have to define everything separate from OWB and call it separately as well.
    Good luck, Patrick

  • How to extract a tpz file contents ?

    Hi to all,
    does anybody know how to extract a tpz file without using XI ? I mean, I want to see the contents of the tpz file to get some code.
    Thanks in advance.

    hi
    The TPZ file contains 2 files. First is a matadata file and other is the TPT file so is there any method to view TPT or TPZ file.
    There is no tool available that I know but has some1 done any development in this field.
    quote
    regards
    krishna

  • How to extract a WAR file..

    Hi,
    How to extract a WAR file.. please help me..
    thanks in advance

    Hi,
    It's simple. If u use tomcat server it put in webapps directory and start server u can see unzip war file. OR
    If u have eclipse editor than u go to project explor and click right than select Export file-->War-->select War file where u put it and click next ---> finish.
    try it

  • How to have iPad (iOS 5) import only the JPEG from a RAW JPEG pair?

    I have an iPad 2 16 GB, running iOS 5. I also have a Canon EOS 7D. I purchased a CF Card Reader for the iPad (see http://store.micgadget.com/card-readers/280-ipad-2-cf-card-camera-connection-kit .html) so that I can view and edit photos quickly in the field, without having to lug my laptop around. To make this easier, I set my camera to shoot RAW+JPEG. I shoot with the smallest JPEG files possible, still a relatively large for the iPad 2,592x1,728, with the idea that I'd only import the JPEG files to the iPad, but still have the RAW files to work with when I get back to my computer. This works great with one exception: the iPad doesn't allow me to import only the JPEG files, but grabs the RAW files along with them. As you can imagine, this fills up my iPad rather quickly, and takes quite a bit longer to import than if it only grabbed the JPEGs.
    So here is my question: How do I have my iPad import only the JPEGs from the RAW+JPEG pairs on the memory card?
    One workaround that helps slightly. If I connect my iPad to my computer after the import, I can go in via Image Capture, select all the RAW images and delete them, leaving the JPEGs behind. This is an underwhelming solution, but does save space after the fact.

    What you are seeing is how Safari works now in iOS 5. There is no way to get that icon in Safari now. There other much better browsers available in the App Store. Look at iCab Mobile, Mercury, Atomic, ....
    I have been running iOS 5x for so long now, that I don't even remember if that icon did appear in earlier iOS versions

  • How can I process raw files in Aperture from a Sony RX1?

    How can I process raw files in Aperture from my Sony RX1?

    Here is a list of supported cameras
    <http://www.apple.com/aperture/specs/raw.html>
    Your Sony RX1 is not listed. Your best bet would be to use the software, that came with your camera to convert the raw files to tiff and to import the tiff to Aperture. Or to shoot raw+jpeg and to import the pairs and to work with the jpeg versions as original master files, until Aperture supports your camera.
    Regards
    Léonie

  • Ho do i unselect the "Do this automatically for files like this from now on." in the download dialog box?

    I have mistakenly clicked on the "Do this automatically for files like this from now on" in the download dialogue box. I want to open a pdf in adobe when I click on the link. currently the file just gets saved and I cannot change it. I have read thru the suggestions and gone into tools> options> applications and reassigned all of the pdf options to ask first and firefox still just downloads the files to somewhere. I don't want this option and I need to unselect the automatic box.
    How do i do so?
    I would really like to talk to someone on the phone.

    Ok, do this:
    #Go to www.getfirefox.com, and download Firefox. Install it over your current version of Firefox
    #After installing Firefox 18, then try to Reset.

  • How do I know what files to remove from my Macbook Pro laptop?

    Apparently my hard drive is full and I need to remove files so I have space to download more music and movies.  I don't want to delete important files.  How do I go about doing this? 

    How do I know what files to remove from my Macbook Pro laptop?
    Remove only files you yourself stored on the laptop; files in your Home folder. Don't delete any files from the system libraries, and if you want to remove applications, use the provided uninstallers.
    For files in the media libraries - iTunes, iPhoto, iMovie use the application to delete music, photos, movies.
    If you are planning on storing more movies and music on your mac, deleting old files will probably not suffice alone to free enough space. Consider to get yourself an external drive to store your media.

  • Can't figure out why the "Do this automatically for files like this from now on" is disabled Compressed (zipped) Folders

    I recently had to uninstall and reinstall Firefox. Now with the new version it will not allow me to click the check box "Do this automatically for files like this from now on". The line is disabled and a light gray. I went into the Applications tab under options and can't find the Compressed (zipped) Folders file type either.
    I download a bunch of files for work and to have to click is going to be the biggest pain. Any help will be greatly appreciated!!

    Screenshot:

  • When downloading a file, I select "Save File", but I'm unable to check the box label "Do this automatically for files like this from now on." The box is faded out. It's very tedious when you have to select "Save File" everytime

    Click on the file to download
    The "Open" Dialog Box pops up
    Select "Save File"
    Try to click on the box labeled ""Do this automatically for files like this from now on."
    The box is disable

    Hello melanie90, see : [https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file#w_changing-download-actions Changing download actions]
    thank you

  • How to  remove the Special characters like @,#,$ ,..from field

    How to  remove the Special characters like @,#,$<,..from text  field. we nedd to remove any specila char from text field .
    ex:text  = just#fi%cation@text
    the text should be justification.

    hi check this ..
    data:char(25) value '5#4#2#&1#&',
         char1(9) .
           replace all occurrences of '#' in char with 'and' .
           replace all occurrences of '&' in char with 'num' .
         write: char.
    or use this..
    data:char(25) value 'test@ing*5#4#2#&1#&',
         char1(9) .
           replace all occurrences of '#' in char with space .
           replace all occurrences of '&' in char with space .
           replace all occurrences of '@' in char with space .
           replace all occurrences of '*' in char with space .
         write: char.
    regards,
    venkat.

Maybe you are looking for

  • Profit center and GL number length

    Hi Dave, Ferry and all, Just like cost center I would like to know the digit lenght of profit center and GL account. Can you tell what Table to go or any other tcode to see the specific requirement my company has created for GL's or Profit center

  • Acrobat 7 plugin not working in Acrobat 8

    Hi, I have developped a plugin that run correctly in Acrobat 7. But if I use it in Acrobat 8 some fucntions are not working. Are there incompatibilities between versions ? Thanks

  • Apple G4

    Hello all,,i want someone to help me plz i need to know if the fcp7 is compatible with apple G4 or not ,,of course for a home use not in a prof. way ,,thanks Karim

  • TS1717 I tunes on iPad is frozen. How do I fix it?

    The iTunes store so is frozen. Anyone know how to fix it?

  • I bought a used iphone and its locked by icloud

    Hello, i need help from the apple people. I bought a used iphone 4 on a swap meet, when i try to activate it says that i need to put the icloud email and password, the thing is i cant find the guy that sold me the iphone, is it posibble to know the e