Split full filename in path und filename

Hi,
is there any FM or method to split an full filename into
path and filename?
example:
full Name = 'C:\TEMP\TMP\TEST.XLS'
Path shell be 'C:\TEMP\TMP'
File   shell be 'TEST.XLS'.
Thanks for help.
regards, Dieter

Hello,
Use this FM,
  DATA: LV_CHECK TYPE PCFILE-PATH.
  DATA: LV_FILE TYPE PCFILE-PATH.
  CLEAR: G_F_FLAG.
  LV_FILE = P_FILE.
  CALL FUNCTION <b>'PC_SPLIT_COMPLETE_FILENAME'</b>
    EXPORTING
      COMPLETE_FILENAME = LV_FILE
    IMPORTING
      PATH              = LV_CHECK
    EXCEPTIONS
      INVALID_DRIVE     = 1
      INVALID_EXTENSION = 2
      INVALID_NAME      = 3
      INVALID_PATH      = 4
      OTHERS            = 5.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  REPLACE ALL OCCURRENCES OF '\' IN LV_CHECK WITH '/'.
If useful reward.
Vasanth

Similar Messages

  • How to display full filename

    Sorry, I know it was talked about before but I can't find it.
    How do you get Aperture to display the full filename under the photo in grid or other view's that includes .nef or .jpg?
    PowerBook G4   Mac OS X (10.4.6)  

    first, check which Metadata set your View Options for Grid are set to; i.e., choose View Options from View.
    next, add (and reorder) File Name from the Metadata/Other popup tab to your Metadata set. that will include the extension.
    if you wish, remove the version name from the set.
    if your thumbnails are small, you might not see the whole file name under the thumbnail in the grid. in fact, you might not see it at all!

  • Can I find out the full filename of input file in message mapping?

    I have in XI 2.0 the following scenario :
    In the inbound fileadapter I read my input file. The filename of the input file is part fixed, part variable (Like INDATA01.txt, INDATA03.txt, etc).
    So in my Adapterconfiguration, I specify the filename with a wildcard (INDATA*.txt).
    What I now want to do, is in my Message Mapping use the full filename , so I can do something different for every filenumber. Is there a way where I can get the full filename available in my message mapping (I did not find the filename in the XML in the message trace).

    You're backing up hundreds or thousands of files:  There's the catalog (database) itself and also the media files. 
    In PSE10, when doing a backup, PSE displays the size of the backup before you begin the actual backup:
    I assume PSE8 will have something similar.
    Ken

  • When listing directory on a website, filename list is only 23 chars, including "... ". How to increase to full filename?

    When listing directory on a website, filename list is only 23 chars, including "...>". How to increase to full filename? Full filename is displayed in notification bar at bottom of window, but only when mouse hovers over trunched filename.
    == This happened ==
    Every time Firefox opened
    == always

    Can you provide an example of where that happens - the URL?

  • Using full filename (with extension) as Title

    I would like iPhoto (iPhoto '11 version 9.1.1) to display the full file name including the extension (e.g., _DSC0003.jpg, _DSC003.nef) as the Title that iPhoto uses so that I can differentiate while browsing.
    My Nikon D200 offers the option of saving the exposure as Basic + RAW and when taken saves as both a .jpg and .nef file so when imported into iPhoto the thumbnails have the same title. I would like to modify this behavior or Batch change the Titles.
    Any solutions?
    Thanks

    There isn't.
    Some possibilities:
    1. Use Smart Albums to differentiate them: the Photo -> is -> Raw condition will help there. Then a Batch Change command will allow you to re-title as you wish
    2. iPhoto automatically tags each Raw on import, so you can use the Keywords in the Inspector
    3. As iPhoto makes a jpeg preview of your Nefs on import anyway, why shoot Raw+Jpg?
    Regards
    TD

  • [SOLVED] Konqueror/KDEmod: Bad icon alignment/disable full filenames?

    Hi guys,
    Hope this is the right place. I have no idea what I might search for to find the answer to this question, as the several queries I made gave results not even close to what I'm looking for on google.. I'm also unsure whether it's an issue with konqueror in specific or KDEmod, so I will leave it here until certain (and then go to the kdemod devs perhaps if its that).
    I've used kde for over a year and a half, and recently switched to Arch in the last month or so and used KDEMod. Loving both. However, I have yet to figure out how to disable this default setting on KDEMod I've never seen before: it rearranges all or some of the icons out of alignment in konqueror.. it -appears- to be doing such so that there is enough room to display the full length of the folder/file name, or at least more letters. I have no idea what it's doing it for, but that's my best guess due to where it shows up. I can't see any obvious switches in the settings or menu bar.
    Many folders do this, and it's seriously annoying not having everything aligned and having icon space wasted. Here's a picture if what I describe isn't clear.
    http://img.photobucket.com/albums/v412/ … pshot5.png
    Note that my icons, scheme, fonts, etc are all exactly the same as they have been in kde before everywhere else, so I don't think that would be the issue.
    Would appreciate if any of you could tell me how to fix this, assuming it's not some strange bug
    Last edited by FrozenFox (2008-04-13 05:57:07)

    That's exactly what I wanted. I was looking for a checkbox of some sort and must have overlooked trying that. Thank you so much!
    Last edited by FrozenFox (2008-04-13 06:03:00)

  • Document Splitting - full balance sheet

    Hello,
    Do we we have to setup Document splitting functionality when the requirement is to have a full balance sheet by Segment, Profit Center or by Business Area or are there other possiblities to meet this requirement?
    Many thanks

    Hi Jan
    I fully subscribe to Chintan's view...
    If you are on ECC version of SAP, does not make sense to ignore Doc Splitting and look for other haphazard avenues
    Br, Ajay M

  • Fileupload issue. Unable to get the full local directory path of the file uploaded

    Fileupload Applet Issue with Firefox 15:
    When uploading a file using our application, file that is being uploaded is hashed using a signed Applet.
    This is working fine in IE and FF version lower than FF15.
    Signed applet needs to hash file contents but it is is unable to read the full path of the uploaded file, and thus failing.
    Applet expects the full path of the file that has been uploaded
    Is there any way to get the full file path?

    Is not a new feature and not really a bug, but rather a security change that they have cleaned up code and removed the ability to use UniversalXPConnect that made it possible in older Firefox versions to get enhanced privileges.<br />
    That is no longer possible, so any code that relies on it will fail silently.<br />
    You will now require an extension to run any code that requires enhanced XPCOM permissions.

  • Splitting columns using xml path

    Please see my script below,
    This is one of the msdn user request but as he is newbie unable to put ddl and dmls.. but all he wants is doing pivot on values.. but I'm trying the same using dynamic pivot which I'm not able to achieve. Help is appreciated.
    Table Script:
    create table #temp(
    ProjectNO int,projectname varchar(10),client varchar(10),programmers varchar(10));
    declare @cols AS nvarchar(MAX)
    ,@QUERY AS NVARCHAR(MAX);
    Insert into #temp
    Select 01 , 'ave' , 'zica' , 'dee'
    UNION
    Select 01, 'ave', 'zica ', 'law'
    UNION
    Select 01 ,'ave', 'zica', 'amy'
    UNION
    Select 01 , 'ave' , 'rowan' , 'dee'
    UNION
    Select 01 ,'ave' ,'rowan' ,'law'
    UNION
    Select 01 ,'ave' ,'rowan' ,'amy'
    Select * from #temp
    Question 1: Desired output:
    ProjectNO. Prjtname Clt1 Clt2 Prog1 Prog2 Prog3
    01 ave zica rowan dee law amy
    Question 2: Query:
    Select distinct Replace((select distinct convert(char(8),client)
    from #temp
    FOR XML path('')) ,'";;#;;"',' ') as clients
    FROM #temp
    GROUP BY ProjectNO
    In the above query I'm doing xml path and I'm getting result in single row like
    clients 
    rowan    zica
    Instead can I get result like below using xml path?
    client1 client2
    rowan  zica
    - please mark correct answers

    For this particular problem we don't want to use XML path. I already answered in the other thread with a link to this article
    T-SQL:
    Dynamic Pivot on Multiple Columns
    Let me know if using that article code you will be able to achieve the goal. It's rather simple, actually, I can write up the mock up idea.
    declare @MaxClients int, @MaxProgrammers int
    select @MaxClients = max(ClientsCount) from (select ProjectNo, count(distinc(Client)) as ClientsCount from #Temp GROUP BY ProjectNo) X
    select @MaxProgrammers = max(ProgrammersCount) from (select ProjectNo, count(distinc(Programmer)) as ProgrammersCount from #Temp GROUP BY ProjectNo) X
    declare @SQL nvarchar(max), @Loop int
    set @Loop = 1
    Actually, that't the beginning of the idea and you should be able to figure this out till completion based on the article I pointed out. We would need to use 2 dense_rank functions.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to split 'Full Name' into two columns for 'First' and 'Last' name??

    Any ideas on how to achieve this? http://office.microsoft.com/en-us/excel-help/split-names-by-using-convert-text-t o-columns-HA001149851.aspx

    If:
    A1 = Fistname Lastname
    For firstname:
    (First Name) B1 =SUBSTITUTE($A1," " & $C1, "")
    For the Last name:
    (Last Name) C1 =RIGHT(A1,LEN(A1)-FIND("#",SUBSTITUTE(A1," ","#",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
    If
    A1 = Lastname, Firstname
    (Last Name) B1 =SUBSTITUTE($A1,", " & $C1, "")
    (First Name) C1 =RIGHT($A1,LEN($A1)-FIND("#",SUBSTITUTE($A1," ","#",LEN($A1)-LEN(SUBSTITUTE($A1," ","")))))
    Let me know if you need one that traps multiple commas or middle names.

  • InitialContext lookup over HTTP using a full PROVIDER_URL (including path)

    Hi,
    We have a standalone Java JMS client application that is sending messages to a queue on a WebLogic (WLS 9.2 MP3) server. It uses the WLInitialContextFactory (WebLogic implementation of InitialContextFactory) class to look up the initial context over HTTP when making the connection to send messages to the queue.
    This all works fine when the client connects directly to the server - i.e. supplies the address of the server as the PROVIDER_URL. However, in our infrastructure, we cannot connect directly from this client to the server; we need to go via a HTTP proxy.
    In a basic configuration HTTP proxy we set the provider URL to be the address of the proxy server, with the proxy is configured to route all requests straight through to the WebLogic server. This configuration also works fine - the JMS client can send messages successfully.
    Unfortunately, this basic proxy configuration is still not sufficient for our Production environment. Our production proxy "fronts" multiple servers, each one identified by the first portion of the URL. So, the proxy is be configured such that requests to "http://proxy/server1/test_request" will be routed on to "http://server1/test_request", whereas a request to "http://proxy/server2/test_request" will be routed to "http://server2/test_request". This configuration works fine for basic HTTP requests, to webpages etc.
    However, when we try we use this mechanism with our JMS client over HTTP, it is not working. We set the provider URL on the client to "http://proxy/server1" in order to send a message to server1. However, we find that the WLInitialContextFactory class seems to be ignoring the final part of the URL ("server1") and still sending requests directly to the root proxy address of "http://proxy", so it doesn't work.
    I appreciate that this can be viewed as a WebLogic specific implementation issue for their WLInitialContextFactory, and I've raised a query with their support people on this. From my own research however, it seems the behaviour of their factory is not different to most other implementations - i.e. the major implementations would all have this issue.
    I'm wondering if anyone is aware of any implementations that would handle the situation I've described. If not (or otherwise!) is there something crazy about our approach that noone has catered for it?! It seems a reasonable situation to me, but maybe I'm missing something!
    Any comments, advice, etc. would be greatly appreciated, thanks.
    Regards,
    Adrian
    Edited by: AdrianFitz on 08-Apr-2010 12:21

    Hi,
    Thanks for the quick response. Would you mind providing a bit more detail on your suggestion, as am not 100% sure I understand it fully.
    If I see what you are getting at, are you talking about configuring proxy settings on my client side, similar to how I have to configure my internet browser with proxy settings when accessing the internet from within my companys LAN?
    If I'm interpreting that right, then I guess my use of the word proxy might be a bit inaccurate or lead to some confusion. What my orginal post described as a proxy should have been more accurately describes as a reverse proxy (acting primarily as a load balancer).
    Ideally, other than changing the URL slightly, the client should be 'unaware' that it is going through a proxy at all.
    Hope that clarifies somewhat, any further comments would be great! Thanks.
    Regards,
    Adrian

  • Nfs showmount shows full server-side path

    exportfs:
    /nfs 192.168.0.0/16(ro,fsid=0,no_subtree_check)
    /nfs/stuff 192.168.0.0/16(ro,no_subtree_check)
    showmount:
    Export list for alix:
    /nfs/stuff 192.168.0.0/16
    /nfs 192.168.0.0/16
    I can mount alix:/stuff, I can't mount alix:/nfs/stuff, so this part works as expected.
    Why does showmount keeps /nfs prefix visible then? Is that how it's supposed to be?
    Can anyone with a working NFSv4 setup please check their showmount output?

    MORE: It looks like you are hosted on an Apache webserver. If you can access your control panel, you can setup the .htaccess to process html with a couple of lines in it. You could log into your .htaccess editor from the control panel.
    You would need to ADD this to your .htaccess:
    AddType application/x-httpd-php .htm
    AddType application/x-httpd-php .html
    That way, html would be process as PHP.
    IMPORTANT:If you add the two lines above to your .htaccess file, make sure you delete
    <!--#include file="header.html" -->
    on the file on the webserver, otherwise, you will have the same problem online and nobody will be able to see your website.
    Message was edited by: Jim Carpenter

  • Split filename and create folders with Powershell script ( --newbie user)

    I have a folder with 1000's of files. Each file varies in length; typically between 9-14 characters. Example:
    C:\workpics\1238955678.1
    C:\workpics\744556224.1
    C:\workpics\744556224.2
    C:\workpics\8445655996.1
    I would like to run a script to split the filename and separate into folders. The filename would then consist of 5 characters, the foldername would be the first characters remaining.
    C:\workpics\12389\55678.1
    C:\workpics\7445\56224.1
    C:\workpics\7445\56224.2
    C:\workpics\84456\55996.1
    Any assistance to create this Powershell script would be awesome. Thank you!!

    I have a folder with 1000's of files. Each file varies in length; typically between 9-14 characters. Example:
    C:\workpics\1238955678.1
    C:\workpics\744556224.1
    C:\workpics\744556224.2
    C:\workpics\8445655996.1
    I would like to run a script to split the filename and separate into folders. The filename would then consist of 5 characters, the foldername would be the first characters remaining.
    C:\workpics\12389\55678.1
    C:\workpics\7445\56224.1
    C:\workpics\7445\56224.2
    C:\workpics\84456\55996.1
    Any assistance to create this Powershell script would be awesome. Thank you!!
    Please reread your request.  It makes no sense.  Read each statement carefully and notice that the statements are in conflict.
    Start your scrip in PowerShell.  Look up things like how to list files and how to manage strings.  All of the information you need is here:
    http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    ¯\_(ツ)_/¯

  • Windows XP, Java and long filenames when running application from a server

    Hi,
    I've been struggling with this for a while, can't understand why Windows XP seems to give me 8.3-filenames with ~ (tilde) instead of the full file- and path-names.
    I've added a key in the registry, when a user right-clicks on a txt-file they get an option to open the file using my program. The key maps to:
    javaw.exe -jar "\\networkdrive\automapper.jar"  "\\networkdrive\Automapper.cfg" "%1"This basically means that javaw will be used to execute my automapper.jar and the automapper.cfg and filename/path will be added as parameters to my java-program. Notice that my jar-file resides on a network-server and not on my local machine. This works just fine though.
    However, when I read the supplied filename in my java-code it is always in Windows 8.3-format using ~ to represent the missing chars. This is not a huge problem since everything works. The problem is that I convert the file and save it with a different file-ending, but with the same name (before the suffix). This means that the user runs my program on:
    this_is_a_long_file_name.txtand ends up with his original file and my new file named something like:
    this_i~1.qqqwhich admittedly looks ugly.
    If I run the application locally on my machine everything works fine and the long file names seems to handled correctly. The problem only arises because the program is run from a server. This is a microsoft network, I do not know anything else about it, sorry.
    Now I know, this is not strictly java-related, but I'm running out of options here and thought that perhaps one of you have solved this before. An option would be that I myself convert the short-filename to a long one, if that is possible? Any pointers would be greatly appreciated! If you don't know the answer, but know a good place to ask I would appreciate that as well.

    It seems to me that if a File (in the java-sense) is created with a 8.3-path it retains that path, meaning that this code will always give the same result in both printLn-statements:
       System.out.Println("input: " + args[2]);
       File file = new File(args[2]
       System.out.Println("output: " + file.getName());will give the output
    input: very_long_file_name_here.txt
    output: very_long_file_name_here.txt
    or
    input: very_~1.txt
    output: very_~1.txt
    regards,
    martin

  • Read character 3+4 from filename and move to other position

    Hello,
    I need a javascript to read my filename (I have the one for the full filename) and especially the 3rd and 4th position of the filename.
    The characters on position 3 and 4 must be moved to the position just before the extension.
    Example:
    4PEN12345.pdf (old name) should be 4P12345_EN.pdf
    Now I have the following script to extract all pages in an existing pdf file to separate pages with all the same suffix before the extension
    /* Extract Pages to Folder */
        var re = /.*\/|\.pdf$/ig;
        var filename = this.path.replace(re,"");
            for ( var i = 0;  i < this.numPages; i++ )
            this.extractPages
                nStart: i,
                nEnd: i,
                cPath : filename + "_page_" + (i+1) + "_EN.pdf"
    Can anybody help me to set me on the right direction?

    Now I have the file 4PBG12345-1.pdf (7 pages included in the pdf).
    Your script as I filled in:
    /* Extract Pages to Folder */
        var re = /.*\/|\.pdf$/ig;
        var filePath = this.path.replace(this.documentFileName, "");
        var oldFileName = this.documentFileName;
        var suffix = oldFileName.substring(2,4);
        var newFileName = oldFileName.substring(0,2) + oldFileName.substring(4).replace(".pdf", "_"+suffix+".pdf");
        var newFilePath = filePath + newFileName;
            for ( var i = 0;  i < this.numPages; i++ )
            this.extractPages
                nStart: i,
                nEnd: i,
                cPath : newFilePath
    Result:
    1 file ==> 4P12345-1_BG.pdf (7 pages included in the pdf)
    Of course, because the syntax for extracting and adding automatic pages is not filled in. So, that was my question, how must I nest to add the right:
    Filepath+oldfilenamesubstring(0,2)+oldfilenamesubstring(4)+_page_i++_+suffix+.pdf in the extract section
    So, my example must result in 7 pdf's:
    4P12345-1_page_1_BG.pdf (with content of page 1)
    4P12345-1_page_2_BG.pdf (with content of page 2)
    4P12345-1_page_3_BG.pdf (with content of page 3)
    4P12345-1_page_4_BG.pdf (with content of page 4)
    4P12345-1_page_5_BG.pdf (with content of page 5)
    4P12345-1_page_6_BG.pdf (with content of page 6)
    4P12345-1_page_7_BG.pdf (with content of page 7)

Maybe you are looking for