Get Information From File Name

Hi,
I have a somewhat general question, is it possible to extract certain "elements" from a file name?
For example: x0 xxx abc 123 xx xxxx.avi (or any type txt, jpg, and etc...).
Assuming that the "abc" is constant throughout the files but the digits are changing (not sequential), can I extract just the "abc 123" (or whatever number it is)?
I know how to strip/build path, but here I don't know what to search since the distance from the beginning is changing and the digits are changing.
Thank you,
Solved!
Go to Solution.

There are several string function that allow you to search for a string, and  break the string into several parts.
Another option is using Regular Expression, yours sound like "abc/s[0-9]{3}", that should return the "abc 123" part.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

Similar Messages

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Get information from an array saved into a text file

    I am trying to get information from an array saved as a text file to extract the information to build an string. This string will go out from the serial port to a device which will listen this message and it will answer the question. All the information sended sequencially it has to be obtained from that array. Every row contain one instruction and this has to be sended one after one.
    Could you tell me if is possible to make this driver? And if you have a similar driver, Where can I get it from?

    The VIs that I would suggest using are found in the String Function Pallet:
    Spreadsheet String To Array
    Array To Spreadsheet String
    The delimiter should be the termination character. These VIs will adapt to a string array.
    For the Spreadsheet String To Array wire an empty string array and use %s as the format. The delimiter should be the termination character of the text file, most likely a end of line (\r\n).
    For the Array To Spreadsheet String the delimiter should be the termination required for your serial device.
    Using a combination of these two VIs should provide you the functions required to make the driver.

  • Ecxpert Problem in getting the original file name submitted by FTP

    hai,
    when i use the scheduled FTP Application receive mode to receive files from the remote machine, i am not able to get the original file name, Ecxpert itself maintaining it's own file name,
    Even i query the tracking table also i am not able to find the original filename.
    If anybody know how i can able to get the original file name?
    thanks....

    I don't think there is an easy to capture this information. We ended up writing our own FTP tool so we could gather better data. The other problem we had seemed to be sporadic downloads from sites where setting Passive was required.

  • How to get information from Oracle's views

    Hi,
    I need to get information from Oracle's views about:
    * in which table's column is set index
    * what type of index is on this column
    * name of a trigger which exist on a table
    * type of trigger (before, after etc)
    * trigger status (enable, disable)
    Thanks for help.

    Hi..
    One of the best way to know which views to use is doing select * from dict where table_name like 'xxx';
    For example in your case you needed to know about the indexes and triggers so
    SQL> select * from dictionary where table_name like 'DBA_IND%';
    TABLE_NAME                     COMMENTS
    DBA_INDEXES                    Description for all indexes in the database
    *DBA_IND_COLUMNS                COLUMNs comprising INDEXes on all TABLEs and CLUSTERs*
    DBA_IND_EXPRESSIONS            FUNCTIONAL INDEX EXPRESSIONs on all TABLES and CLUSTERS
    DBA_INDEXTYPES                 All indextypes
    DBA_INDEXTYPE_COMMENTS         Comments for user-defined indextypes
    DBA_INDEXTYPE_ARRAYTYPES       All array types specified by the indextype
    DBA_INDEXTYPE_OPERATORS        All indextype operators
    DBA_IND_PARTITIONS
    DBA_IND_SUBPARTITIONS
    DBA_IND_STATISTICS             Optimizer statistics for all indexes in the database
    10 rows selected.
    SQL> select * from dictionary where table_name like 'DBA_TRI%';
    TABLE_NAME                     COMMENTS
    DBA_TRIGGERS                   All triggers in the database
    DBA_TRIGGER_COLS               Column usage in all triggers
    Reading the comments you can know which view to use, then  describe the view and use what you need

  • Getting the Source File name Info into Target Message

    Hi all,
    I want to get the Source file name Info into Target message of one of the fields.
    i followed Michal BLOG /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Requirement :
    1) I am able to get the Target file name as same as the source file name when i check the ASMA in Sender & Receiver Adapter , with out any UDF...............this thing is OK
    2) I took One field extra in the target structure Like "FileName" & I mapped it Like
                              Constant(" " )--UDF-----FileName
    I Checked the Option ASMA in Both Sender & Receiver Adapters
    Here iam getting the Target File name as same as Source file name + Source File name Info in the Target Field " FileName".
    I Dont want to get the Target File name as same as Source file name. I want like Out.xml as Target file name.
    If i de-select the Option ASMA in Adapters means it is showing " null" value in the target field "FileName".
    Please Provide the Solution for this
    Regards
    Bopanna

    Hi All,
    Iam able to do this by checking the Option ASMA in only sender adapter itself
    Regards
    Bopanna

  • Getting error logical file name not maintained adequtely

    Hi,
    when i execute a z report and press the download botton getting error logical file name not maintained adequtely,see long text.
    Below code i wriien. Please somebody help..
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'DOWNL'.
    Determine and construct OS specific file name                        *
            PERFORM get_file_name_for_os.
    in the  above perform , i wriien
    FORM build_file_name USING pf_os
                               pf_with_file_extension
                               pf_param_1
                               pf_format
                               pf_fname.
      DATA: lf_para1(20) TYPE c.
    pf_param_1 hold the materialnr with leading zeros not prefered in    *
    download file name                                                   *
      WRITE pf_param_1 TO lf_para1.
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
      CLIENT                        = SY-MANDT
          logical_filename              = 'Z_MATERIAL_BOM_FILE'
          operating_system              = pf_os
          parameter_1                   = lf_para1
      PARAMETER_2                   = ' '
      PARAMETER_3                   = ' '
      USE_PRESENTATION_SERVER       = ' '
          with_file_extension           = pf_with_file_extension
      USE_BUFFER                    = ' '
        IMPORTING
      EMERGENCY_FLAG                =
        file_format                   = pf_format
        file_name                     = pf_fname
    EXCEPTIONS
       file_not_found                = 1
       OTHERS                        = 2
    Error handling.
      CASE sy-subrc.
        WHEN '1'.
          MESSAGE e014(ba) WITH 'Z_MATERIAL_BOM_FILE'.                     "error message i am getting      LEAVE.
        WHEN '2'.
          MESSAGE e213(ky) WITH 'Z_MATERIAL_BOM_FILE'.
          LEAVE.
      ENDCASE.

    Hi.
    In file txn,
    click on "Logical File Name Definition, Cross-Client" from the left.
    Then click position and check for your logical file name.
    If you dont get it, it means you need to create it. You can click on New Entries to create.
    Thanks
    Mani

  • File type from file name

    Hi,
    Is there any standard method to get a file type from file name?
    File name can be ‘C:\test.doc’ or “C:\test’(test – is file) i.e. with or without file type extension.
    ...Naddy

    You can use the Function module PC_SPLIT_COMPLETE_FILENAME
    export paramter extension will tell the type of file
    Sample Output
    Import     COMPLETE_FILENAME     C:\TEST.TXT
    Import     CHECK_DOS_FORMAT     
    Export     DRIVE     C
    Export     EXTENSION     TXT
    Export     NAME     TEST
    Export     NAME_WITH_EXT     TEST.TXT
    Export     PATH     \

  • FM for getting the logical file name

    Hi,
    is there any FM for getting the logical file name.
    Thanks
    Vikranth

    Hi,
    CONSTANTS: c_mask          TYPE char9      VALUE ',.,..'.
          Pick up the file path from the application server
    FORM f1001_browse_appl_file .
      DATA:  lcl_directory  TYPE char128.
      lcl_directory  = p_direct.
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = lcl_directory
          filemask         = c_mask
        IMPORTING
          serverfile       = p_f2  " Parameter File
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
       MESSAGE e000(zmm) WITH text-039.
       flg_app = 'X'.
      ENDIF.
    Then use  OPEN DATASET for data reading
    Hope this Helps.
    Manish
    Message was edited by:
            Manish Kumar

  • WCF Service and Sharepoint Form library : How i can read a access a form libray and query a item from file name and read form xml in WCF service ?

    WCF Service and Sharepoint Form library : How i can read or access a form libray and query a item from file name and read form xml in WCF service ?
    Ahsan Ranjha

    Hi,
    In SharePoint 2013, we can take use of REST API or Client Object Model to access the SharePoint objects like Form Library.
    SharePoint 2013 REST API
    http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx
    http://blogs.technet.com/b/fromthefield/archive/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript.aspx
    SharePoint 2013 Client Object Model
    http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
    With the retrieved file, we can then use XmlDocument object to parse it and get the values you want:
    http://weblogs.asp.net/jimjackson/opening-and-reading-an-xml-file-in-a-document-library
    http://stackoverflow.com/questions/1968809/programatically-edit-infopath-form-fields
    Best regards
    Patrick Liang
    TechNet Community Support

  • Cloud does not disappear from file name?

    why does it take "forever" for the cloud to disappear from file name?
    I saved a numbers document to the cloud a half an hour ago, and the cloud is still there.

    HDash-Tech,
    thanks for the tip, but since I have my iTunes Library on a NAS I have to direct iTunes every now and than via "choose library" to the folder and it doesn't make a difference...
    I think it's somehow due to my iTunes Match.  I know they do not sync audiobooks, but they mess up pretty much everything else within my library.  Songnames here and there and especially cd covers!
    Any other idea how to get it straigten out again?
    Thank,
    Daniel

  • How to get information from my laptop to my ipad

    I`m new on I-pad
    How to get information from my laptop to my ipad
    Saludos
    Josè Montero

    Heres some Apple Support tips on the subject.
    How to transfer and sync content to your computer:
    http://support.apple.com/kb/ht1296
    How to transfer files between your computer and mobile apps:
    http://support.apple.com/kb/PH1693
    How to do file transfers:
    http://support.apple.com/kb/HT4094

  • IS Possible to get information from GetUserProfileByName inside of repeat section

    IS  Possible to get the values from GetUserProfileByName inside of repeat section? by Codeless
     and then with this result used to filter DDL
    Or GetUserProfileByName  is only useful when it is used for FORM LOAD
    CRISTINA&amp;amp MICROSOFT Forum

    Hi,
    According to your description, my understanding is that you want to use the GetUserProfileByName service in InfoPath form.
    We can get information from GetUserProfileByName inside of repeating section, however you need to give the name of user so that the service can be used to get the details of the user.
    Please refer to the link below:
    http://thinketg.com/using-infopath-and-the-web-service-getuserprofilebyname/
    You can create rules to query for data using GetUserProfileByName, and it is not only useful for form load.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • How can I extract metadata from file names?

    If I want to extract metadata from file names? How can I do that? I want to read through the file names and when I get to a certain character ("-"), I can take the string just before that character and store it in a column in SharePoint. Is this
    do-able through scripting? 

    If I want to extract metadata from file names? How can I do that? I want to read through the file names and when I get to a certain character ("-"), I can take the string just before that character and store it in a column in SharePoint.
    Is this do-able through scripting? 
    You should be able to leverage the split method.
    In PowerShell It would look like:
    # Gather the file name
    $file = "myawesome_filename-Month-Day-Year-Ect.doc"
    #split the file name by the "-" character
    $file = $file.split("-")
    # Use a foreach Loop to gather the individual items.
    foreach ($item in $file) {
    write-host $item
    #Outputmyawesome_filename
    Month
    Day
    Year
    Ect.doc
    # If you want to only grab the first item, you can do $file[0] <-- powershell starts counting with zero base.
    $file[0]
    #output
    myawesome_filename
    Entrepreneur, Strategic Technical Advisor, and Sr. Consulting Engineer - Strategic Services and Solutions Check out my book - Powershell 3.0 - WMI: http://amzn.to/1BnjOmo | Mastering PowerShell Coming in April 2015!

Maybe you are looking for

  • No WIFI after iOS 5.0.1 over-the-air update on original iPad

    No WIFI after iOS 5.0.1 over-the-air update on original iPad. I have reset the network settings,  power off the iPad, trying static IP and nothing, it's unable to join my wifi network. anybody with the same issue?

  • Error installing flash player

    I download the installation file, have tried saving it and just opening it directly after downloading from adobe.com and filehippo.  I have verified that I am downloading for the correct version of windows and that I want to use it for Internet Explo

  • Are the i5/i7 processors way better than the Core 2 Duo?

    Currently travel with my MacBook, but it's heavy (Pro stays home).  I'm considering replacing the MB with an Air with 4GB RAM/256GB HD and I'm looking at refurbs.  Go with the new i5 or i7 or is the Core 2 close enough?  Thanks.

  • Wrong values shown in Bex report

    Hi, I've created a Bex report using 0IC_C03. my report is pretty simple, it has 0VALSTCKVAL as the key figure. As characteristics i have plant/ Movement type/ Storage location Initial view it shows by Plant and no problems with the figures, but when

  • Finger print scanner of my hp dv6 not working laptop running on windows 7 home primium x64 efition

    my finger print scannernot working   tried almost all posible measures. staarting from recovery to early time to reinstalation of software and hardware                                          expect u people will help me !!