Filename from complete file path

Hi,
   can anybody let me know the method to get the filename from the complete filepath( this path includes both directory as well as filename)
regards.
venkat.

Hi,
Check the below code:
data : ig_path type standard table of tp_path,
       wg_path type tp_path.
data : g_lines     type i          ,
       g_filename  type string     .
parameter : p_input type rlgrap-filename.
  split p_input at '\' into table ig_path.
  describe table ig_path lines g_lines.
  read table ig_path index g_lines into wg_path.
  g_filename = wg_path-val.
write : g_filename.
Regards,
Raghu

Similar Messages

  • Obtaining file name from the file path given

    hi,
    how to obtain  file name from the file path given

    Hi bharath,
    1. PC_SPLIT_COMPLETE_FILENAME
    2.
    DATA : path LIKE pcfile-path.
    DATA : extension(5) TYPE c.
    path = filename.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    * CHECK_DOS_FORMAT =
    IMPORTING
    * DRIVE =
    extension = extension
    name = name
    * NAME_WITH_EXT =
    * PATH =
    EXCEPTIONS
    invalid_drive = 1
    invalid_extension = 2
    invalid_name = 3
    invalid_path = 4
    OTHERS = 5
    regards,
    amit m.

  • Send Filename from j2se FILE Adapter

    Hi,
    I need store filename from local file to xml element. When I use j2ee adapter there is no problem. I sended Filename to Adapter Metadata and through DynamicConfigurationKey in mapping I write it to element.
    My question is: How could i do it in j2se plain adapter? (In our customer there is no way for using j2ee adapter)
    Many thanks,
    Paul.

    hi,
    try this
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //obtengo la Key del FileName
    DynamicConfigurationKey keyF = DynamicConfigurationKey.getName();
    http://help.sap.com/javadocs/NW04/current/pi/com/sap/aii/mapping/api/DynamicConfigurationKey.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516
    /people/mohammed.zabiulla/blog/2008/03/26/have-you-ever-tried-to-determine-mail-cc-dynamically
    Hope it helps
    Thanks
    Rodrigo
    Edited by: Rodrigo Pertierra on Apr 11, 2008 9:31 AM

  • Open Recent - CS3 Complete File Path

    In CS2 my open recent files showed the complete file path. e.g. d:\jobs\clients name\file name.indd.
    In CS3 it only shows file name without the complete path.
    Is there a setting to change this or am I stuck with it?

    CS3 will show the complete path if it is necessary to eliminate ambiguity.
    Dave

  • How to get physical file path from logical file path

    Hi
    there is a immediate requirement ,
    I have logical file path but I need to get physical file path from it.
    So is there any FM which providesthis functionality.
    Points will be rewarded.
    Thanks

    Can you please share the piece of code ?
    Which File APIs are you using ?
    For java file, you can get complete path by simple method call : getAbsolutePath() on file object.
    Regards,
    Ashwani Kr Sharma

  • File-to-file scenario: no mapping, filename from sender file

    Hi all,
    file-to-file without mapping.
    we want to use XI to transport just files from XI file directory to another ftp-server (+ archiving on xi file directory)
    we configered an sender file adapter that picks the file up, but
    we have problems configuring the receiver adapter in that way that the filename or the original file is used
    Is that possible? with which parameter settings
    filename is not content of the XI message content so "message:FileName" doenst work
    Thank you very much
    regards
    Hans

    Hi Hans,
    Check this link:
    How to send any data (even binary) through XI, without using the Integration Repository
    OR
    Copy a file with same filename using XI
    Sachin
    Edited by: Sachin Dhingra on Nov 7, 2008 8:19 PM

  • Read filenames from jar-file

    Hi,
    I want to read image names in a jar-file directory in a web start application. This used to work in previous versions of jdk,
    but when I use jdk 1.6.0_20 I get this errormessage:
    "http:\server:8080\test\client.jar The filename, directory name, or volume label syntax is incorrect".
    Why doesn´t this work anymore?
    Some of my code looks like this:
         getFiles("images/toolbuttons/val/", ".gif", true);
         public String[] getFiles(String catalog, String fileNameEnd,
             boolean removePath)
              JarFileFinder jarFileFinder = new JarFileFinder();
              String jarFilePath = jarFileFinder.getClassLocation(
                  this.getClass().getName());
              String[] files = null;
              try
                   if (fileNameEnd != null)
                        fileNameEndFilter = new FileNameEndFilter(fileNameEnd);
                   files = getFilesInJar(jarFilePath, fileNameEndFilter, catalog,
                       removePath);
              catch (Exception e)
                   MessageUtil.messageOk(null, this.getClass().getName(), e.getMessage());
              return files;
         private String[] getFilesInJar(String jarFilePath, FilenameFilter filter,
             String catalog, boolean removePath)
             throws Exception
              ZipFile zipFile = new ZipFile(jarFilePath);
              Enumeration e = zipFile.entries();
              String name;
              ZipEntry zipEntry;
              ArrayList filesList = new ArrayList();
              while (e.hasMoreElements())
                   zipEntry = (ZipEntry) e.nextElement();
                   name = zipEntry.getName();
                   if ((filter == null || !filter.accept(null, name)) ||
                       (catalog != null && !name.startsWith(catalog)))
                        continue;
                   if (removePath == true)
                        name = name.substring(name.lastIndexOf("/") + 1);
                   filesList.add(name);
              String[] files = new String[filesList.size()];
              for (int i = 0; i < filesList.size(); i++)
                   String s = (String) filesList.get(i);
                   files[i] = s;
              return files;
    public class JarFileFinder
         public String getClassLocation(String classname)
              try
                   Class clazz = Class.forName(classname);
                   if (clazz == null) return null;
                   URL url =
                       clazz.getProtectionDomain().getCodeSource().getLocation();
                   String location = url.toString();
                   if (location.startsWith("jar"))
                        url = ((JarURLConnection)
                            url.openConnection()).getJarFileURL();
                        location = url.toString();
                   if (location.startsWith("file"))
                        return new File(URLDecoder.decode(url.getFile(), "UTF-8")).getAbsolutePath();
                   else
                        return URLDecoder.decode(url.toString(), "UTF-8");
              catch (Exception e)
                   MessageUtil.messageOk(null, this.getClass().getName(), e.getMessage());
              return null;
    }

    AndrewThompson64 wrote:
    Lisa_R wrote:
    ..I tried to remove the URLDecoder, but the result was the same. I still get:
    "http:\server:8080\test\client.jar The filename, directory name, or volume label syntax is incorrect".Given an URL should use '/' as opposed to '\', and starts with 2 '/' rather than one, it is not surprising that URL was rejected. Strange as it may seem, programming by typing random characters into an editor will rarely, if ever, work to create a working application.Yes, I agre that it´s not that surprising that the URL was rejected (even though the URL work in firefox and IE). But I didn´t write it that way. The code that put the URL together worked fine in previous versions of the jdk.
    >
    ..The reason why I want to read the filenames from the jar instead of including a list of the names is that if you
    want to add an image then all you have to do is include it in the directory.. That is largely irrelevant, since the Jar needs to be freshly built, uploaded by the developer, and downloaded by the client. Since all of that needs to be done for the addition of a single image, you might as well add an Ant task to the build that provides a single file (like I suggested earlier) that lists the resources of interest. It would take less time to write an Ant task, than debug all the hoops the code is currently jumping through(1) in order to get the information of interest.
    If this was the only place were this method was used I would agre with you, but unfortunatelly it´s not. The application dosen´t only read image filenames it also reads class-names.
    1) And even if you got that working, it would be likely that Sun would introduce some change in the next version of Java that breaks it again. My advice is to stop fighting it, and go with the flow.Thats not good of course! But it has been working for a long time, so I think I will try to make it work again....
    Is there someone out there who has done this or knows how to do it I would appreciate some help! :-)

  • Getting complete file path in Adobe Interactive Form

    Hi All,
    I have a requirement where I have a field ZPATH1 on Adobe Interactive Form. I am putting a BROWSE button and writing following JavaScript on CLICK event on this button for populating the chosen file path into field ZPATH1.
    *Start of JavaScript
    var sFile;
    event.target.importDataObject(sFile);
    var oFile;
    oFile = event.target.getDataObject(sFile);
    this.parent.parent.Sub_Form_Fields_Mass.ZPATH1.rawValue = oFile.path;
    *End of JavaScript
    1. event.target.importDataObject(sFile) --> Giving me the pop up to select the file.
    2. this.parent.parent.Sub_Form_Fields_Mass.ZPATH1.rawValue = oFile.path; --> Putting the oFile path in field ZPATH1 on the form.
    3. This way is only giving me the selected FILE NAME whereas I need the complete path.
    I have tried below way also:
    this.parent.parent.Sub_Form_Fields_Mass.ZPATH1.rawValue = even.target.path;
    This function returns me the complete path but in URL form. It does not give me the presentation server path.
    Please suggest me how to get the complete path of presentation server to the file.
    Appreciation would be honored in form of points!!!
    Regards,
    Ashish

    please post it here for quick response
    and also search in adobe forums also for java script related.
    http://www.adobe.com/support/forums/index.html

  • Missing Photographs - 5,000 in total - is there a programmatic way to get the complete file paths missing?

    HostOS : Mac OS X
    LightRoom version : 4.4
    I accidentally moved linked files over the past few years, and just discovered (via "Missing Photos" view) that I have 5,000 missing photos.
    I know the master photos are on my hard disk drive ... so, that is the good news.
    BUT I do not want to have to click to re-link all 5,000 missing photos one at a time.
    Is there a way to programmatically get the list of file paths of those 5,000 missing photos on my MacOSX system  -- so that I can write an AppleScript to extract the unique image file name from the full file path extracted from LightRoom, locate the image in Finder, and move it back to the expected file path where Lightroom expects to find it?

    If most of your reorganization consisted of moving whole folders rather than individual pics,  you can quickly relink entire folders, or even folders of folders, rather than individual pics.  In the Folders pane on the left, right-click the missing folder and select Find Missing Folder.
    If you moved individual files rather than entire folders, then to get a list of the file paths of all the missing files, first do Library > Find All Missing Photos. Then use the ListView plugin to get a list of the photos' file paths into a text file.

  • Getting complete file path in Acro Java Script

    Hi All,
    I have a requirement where I have a field ZPATH1 on Adobe Interactive Form. I am putting a BROWSE button and writing following JavaScript on CLICK event on this button for populating the chosen file path into field ZPATH1.
    *Start of JavaScript
    var sFile;
    event.target.importDataObject(sFile);
    var oFile;
    oFile = event.target.getDataObject(sFile);
    this.parent.parent.Sub_Form_Fields_Mass.ZPATH1.rawValue = oFile.path;
    *End of JavaScript
    1. event.target.importDataObject(sFile) --> Giving me the pop up to select the file.
    2. this.parent.parent.Sub_Form_Fields_Mass.ZPATH1.rawValue = oFile.path; --> Putting the oFile path in field ZPATH1 on the form.
    3. This way is only giving me the selected FILE NAME whereas I need the complete path.
    I have tried below way also:
    this.parent.parent.Sub_Form_Fields_Mass.ZPATH1.rawValue = even.target.path;
    This function returns me the complete path but in URL form. It does not give me the presentation server path.
    Please suggest me how to get the complete path of presentation server to the file.
    Appreciation would be honored in form of points!!!
    Regards,
    Ashish

    I don't recognize the tech - is it something related to BusinessObjects Enterprise?
    Sincerely,
    Ted Ueda

  • Getting file name from a file path

    Hello
    I have got a String called filePath and it holds: "C:\Documents and Settings\paul\MyDocuments\nihtd.txt".
    What I want do is to have another String variable called fileName that will use the 'filePath' variable to return the name on the file (that been "nihtd.txt" for the example given) but it must work with any file path for any file type.
    Can anyone help? I have tried various ways but with no success.
    Many thanks
    Paul

    Hmm, I just ran across another distinction between doing this by creating a File object as opposed to doing this by analysing the String: performance.
    I always thought that creation of file objects is relatively cheap, since the Filesystem is not actually accessed when you create a new File instance. Apparently that is not true, at least not if you are on Windows and the file is on another server. Something like new File(\\server\share\file.txt) will create network traffic on Windows. So if you only meant to use the File class for parsing text, you might want to think again.
    I would be interested to know how the FileSystem class is implemented on different platforms. Do you know where I can read up on that?
    Cheers, HJK

  • SSIS - Loop through files from a file path based on the value in the variable

    Experts,
    I have a requirement where I'll be loading multiple files in to a SQL server table and archive the files when loaded. However, the challenge is , the file path should be dynamic based on the value of a variable (say, @ProductName).
    For example: If I am running the package for variable @ProductName="Product", the file path would be "\\....\Src\Product", in that case the ForEachLoop will loop through all the files in that folder, load them to the table and Archive
    the files to the "\\....\Src\Product\Archive" folder.
    Similarly, if the @ProductName="Product_NCP", the foreachloop container should loop through files in the "\\....\Src\Product_NCP" folder, load them to the table and archive them to the ""\\....\Src\Product_NCP\Archive"
    folder.
    Any suggestions? I should be able to run the package manually just by passing the "@Product" value, create Archive folder if it doesn't exist, load the data and archive the files.

    Yes
    1. Have a variable inside SSIS to get folder path. Set path based on your rule using an expression
    like
    (@[User::ProductName] == "Product" ? "\\....\Src\Product" : (@[User::ProductName] == "Product_NCP" ? \\....\Src\Product_NCP:..))
    similary archive
    (@[User::ProductName] == "Product" ? "\\....\Src\Product\Archive" : (@[User::ProductName] == "Product_NCP" ? "\\....\Src\Product_NCP\Archive" :..))
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Loading JSON files from URLS/File Paths into a After Effects

    Basically, I want to make a script in which the user enters a file path or URL of a JSON file, the file is loaded and the user can manipulate the data in various ways within After Effects.
    I got as far as writing a script that requests the data and logs it into the console but it will only work in Extendscript. I'm using Extendables which was built for indesign so that may be the problem.
        #include Extendables/extendables.jsx
        var url = "http://echo.jsontest.com/key/value/otherkey/othervalue";
        //Retrieve the data
        function retrieveData(_url){
            var http = require("http");
            var response = http.get(_url);
            var responseStr = JSON.stringify(response);
            var responseBod = JSON.parse(responseStr);
            var data = JSON.parse(responseBod.body);     
            $.writeln(data.key);
        retrieveData(url);
    When I run it in After Effects I get an error "Undefined is not an object" pointing to line 162 in errors.jsx which says:
    if (app.name.to('lower').contains("indesign")) {
    What exactly is happening here? Is there a better way to go about doing requesting JSON files?
    Thanks!
    EDIT: I should add that I tried removing the "$.writeln(data.key);" but am still getting the same error.

    The line that generates the error tries to test whether the targetted application is InDesign, and the test is not so good because in other apps the test may generate an error.
    (For AfterEffects, the object 'app' exists [object Application] but it doesnt have a 'name' property, so app.name.xxx is wrong).
    I don't know of a test that would work for any app. For After Effects, "if (app.effects instanceof Array)" might work, not sure.
    If the script is meant to target AfterEffects only you can simply omit the condition.
    Xavier

  • Retrieve file name from full file path

    I am trying to retrieve a file name from a path (ex. c:\temp\tes.txt) using the following code, but it is given me an error of "The method split(String) in the type String is not applicable for the arguments (char).
    {code}
    String filepath = item.getName();
    String[] buf = filepath.split('/');
    String filename = buf[buf.length-1];
    {code}
    I tried to use double quote instead of single quote, but it is not returning anything.
    {code}
    String[] buf = filepath.split("/");
    {code}
    Anyone knows why? Thanks.

    How is this related to JDBC?
    Anyway, is the path separator actually a forward slash? Isn't it a backward slash?
    If you're using Apache Commons FileUpload (which I guess, the 'item.getName()' is recognizeable), then just read their FAQ: [http://commons.apache.org/fileupload/faq.html#whole-path-from-IE].

  • Complete file path

    I am trying to get a file to open, but it doesn't pass the complete path to the file. Does any one know how to get the complete path? I am using Windows 2000.
    else if (evt.getSource() == openButton)
         {int returnVal = fc.showOpenDialog(this);
                  if (returnVal == JFileChooser.APPROVE_OPTION){
                  String file = fc.getSelectedFile().getName();
                  nameField.setText(file);}}
    } // actionPerformed()
    Thanks for your help

    "fc.getSelectedFile()" returns you a File object (as you can see if you look in the API documentation for JFileChooser). For a File, its API documentation tells you about the getCanonicalPath() method in rather abstract terms, but if you squint carefully you'll see it's the answer to your question. Thus, you need to write
    String file = fc.getSelectedFile().getCanonicalPath();The API docs are your best friend, you'll be well advised to browse them a lot as you learn Java.

Maybe you are looking for

  • BT Yahoo e-mail Account and MacBook Pro

    Hi All This is my very first post, so please be patient if this topic has:  1) Already been covered.  The ones I have found seem a bit too technical for me (embarrassing!) 2) Shows I'm a bit of a novice For a number of months now I have been happily 

  • SWF insert shows clear border in Safari, but not IE

    Hi... I'm trying to fit a Flash project into my HTML page perfectly between images without borders to look like one big image.  It looks perfect in IE, but not safari. I've spent hours researching but can't find a fix.  When I insert an SWF file into

  • Order combination in Outbound delivery

    Hi, I have a problem. We have a lot of Sales orders with different Sold-to-Parties but all have the same Ship-to-party so we want all the orders to be combined in to one delivery when creating the deliveries in VL10A. But that is not the case, I get

  • I pad not seen in widows or I tune

    I updated the iOS, and now it will not reboot. I have hard booted at and it will only go as far as the apple icon. When I attach it to my widows machine, neither ITunes or Windows sees the Ipad2.

  • IPhone 3G  uses Smaller Battery / Question

    According to this tear down: http://live.ifixit.com/Guide/First-Look/iPhone3G The battery is actually lower in capacity than of the original iPhone. My question is: Would it be possible to replace the included Battery with a larger size?