Commons Net - List files with more than a wildcard "*" in path

Hello everybody!
I�m starting to use commons net library in a java project, and I have this doubt: I need to list files in a ftp server, for instance, like this �action*/slot*-qual*.txt�
i.e., I want to list all the files like �slot (something) � qual (something) .txt�, in all directories beginning with �action (something)�.
When I put this path in a variable named �path� and pass it to the listFiles method, it returns me a list of zero files. But, for instance, if I only pass the path �action*�, the listFiles returns me all the directories beginning with �action�, like action01, action02, etc. The same happens if I pass only �slot*-qual*.txt�, giving me all the files that respect the command, within a certain directory, like slot1-qual101010.txt, slot2-qual10.txt, slot3-qual1.txt, etc.
So, there�s must me a method to do this kind of listing, isn�t it? Is it possible to list the files like this?
If I put the command �ls action*/slot*-qual*.txt� in an ftp client that I use, I get the correct list that I need, so it works like this!
Thanks a lot everybody!
Andr� Augusto
FTPClient ftp;
FTPFile[] files;
files=ftp.listFiles(path);
for (int i=0; i<files.length; i++)
logger.info("Index: "+i+ " -> Name: " +files.getName());

Hello everybody!
I�m starting to use commons net library in a java project, and I have this doubt: I need to list files in a ftp server, for instance, like this �action*/slot*-qual*.txt�
i.e., I want to list all the files like �slot (something) � qual (something) .txt�, in all directories beginning with �action (something)�.
When I put this path in a variable named �path� and pass it to the listFiles method, it returns me a list of zero files. But, for instance, if I only pass the path �action*�, the listFiles returns me all the directories beginning with �action�, like action01, action02, etc. The same happens if I pass only �slot*-qual*.txt�, giving me all the files that respect the command, within a certain directory, like slot1-qual101010.txt, slot2-qual10.txt, slot3-qual1.txt, etc.
So, there�s must me a method to do this kind of listing, isn�t it? Is it possible to list the files like this?
If I put the command �ls action*/slot*-qual*.txt� in an ftp client that I use, I get the correct list that I need, so it works like this!
Thanks a lot everybody!
Andr� Augusto
FTPClient ftp;
FTPFile[] files;
files=ftp.listFiles(path);
for (int i=0; i<files.length; i++)
logger.info("Index: "+i+ " -> Name: " +files.getName());

Similar Messages

  • Is there a way to open CSV files with more than 255 columns?

    I have a CSV file with more than 255 columns of data.  It's a fairly standard export of social media data that shows volume of posts by day for the past year, from which I can analyze the data and publish customized charts. Very easy in Excel but I'm hitting the Numbers limit of 255 columns per table. Is there a way to work around the limitation? Perhaps splitting the CSV in two? The data shows up in the CSV file when I open via TextEdit, so it's there. Just can't access it in Numbers. And it's not very usable/useful for me in TextEdit.
    Regards,
    Tim

    You might be better off with Excel. Even if you could find a way to easily split the CSV file into two tables, it would be two tables when you want only one.  You said you want to make charts from this data.  While a series on a chart can be constructed from data in two different tables, to do so takes a few extra steps for each series on the chart.
    For a test to see if you want to proceed, make two small tables with data spanning the tables and make a chart from that data.  Make the chart the normal way using the data in the first table then repeat the following steps for each series
    Select the series in the chart
    Go to Format sidebar
    Click in the "Value" box
    Add a comma then select the data for this series from the second chart
    Press Return
    If there is an easier way to do this, maybe someone else will chime in with that info.

  • How can I search for files with more than one keyword?

    I´ve created some keywords, and some files in my folder are tagged with two, three or more keywords.
    Is there a way to search for files using more than one keyword on the search field?
    Thanks!

    Use the Find command (menu Edit) and in criteria at the right side is a plus sign to add another criteria and set it to your custom wishes.
    make a choice in results and you should be OK

  • Attach xls file with more than  255 chars

    Hi all,
    I'm trying to send an .xls file as attachement whose row contains more than 255 chars with FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    When preparing the attached table, I tried to separate the tables like this:
    loop at itab.
      concatenate itab-col_1 itab-col_2 itab-col_3 into it_attach
        separted by cl_abap_char_utilities=>horizontal_tab.
      append it_attach.
      concatenate itab-col_4 itab-col_5 itab-col_6 into it_attach
        separted by cl_abap_char_utilities=>horizontal_tab.
      append it_attach.
      concatenate IT_ATTACH cl_abap_char_utilities=>newline into it_attach.
      append it_attach.
    endloop.
    I am able to send this xls as attachment, but when open it in excel/notepad,
    it is so strange that there are so many spaces before the contents itab-col_4 which is unexpected.
    It is expected that the file is tab-delimited with continuous column 1-6.
    Any things went wrong?
    Many Thanks!

    Thanks.
    I tried the first method to convert the byte to string, but a short dumps is resulted,
    DATA: con_tab TYPE x,
               sep TYPE string.
    con_tab = '09'.
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
                EXPORTING
                  in_xstring = con_tab
                IMPORTING
                  out_string = sep.
    so I use back my original method to concatenate the columns as suggested, i.e.
    concatenate itab-col_1 tab itab-col_2 tab itab-col_3 tab into it_attach
    append it_attach.
    concatenate itab-col_4 tab itab-col_5 tab itab-col_6 into it_attach.
    append it_attach.
    concatenate it_attach cl_abap_char_utilities=>newline into it_attach.
    append it_attach.
    but the outcome is still the same, i.e. ...many leading space before itab-col_4
    any more ideas? Many Thanks

  • LP 10 support scala tuning files with more than 12 notes? Does it support octaves larger or smaller than 2/1?

    LP 9 limits the amount of notes in an octave to 12 and the octaves must be 2/1 as far as I know.
    This makes using exotic scales like 31tet or Wendy Carlos Alpha/Beta/Gamma scales impossible.
    The only reason I'd upgrade to LP 10 at this point is if they've fixed that... and the many bugs in LP 9.

    The main issue you are having is that you are using a 32 bit OS. The memory limitations for a 32 bit OS is 4G. If memory is serving me, the way linux allocates memory in a 4 GB system is that it divides it into 4 different chunks. 1G for the kernel, 1G for user processes (aka database instance), 1G for libaries, and the last G I can't remember right now. In essense you have 1G of memory to play with for user processes. You can relink the oracle executables to load lower into memory to give you more space for user apps, but I think the limit here is somewhere around 1.8G. To use more than 4G of memory you need to use either hugemem, or I believe there is another method. You would need to look at the RH doc on how to do this. Is it an option to use the 64bit version of RH? This would eliminate this problem altogether.

  • Creating Interactive Files with more than one URL

    Hello, here's my problem: I want to create more than one button instance that go to different URL address's. From the Adobe Video Workshop, I got the code:
    interactive_test.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    This works fine with one button instance. When I copy and paste the code for another button instance, i.e:
    butn1.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    butn2.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    I get 1021 duplicate function error. I think I understand in priciple what's wrong but don't know how to fix it. MyI knowledge of Action Script 3 is zero. What I need is sample code that works that I could copy and paste, with appropriate changes.
    Thanks in advance for your help, Richard

    use different function names or flash won't know which function to use:
    butn1.addEventListener(MouseEvent.CLICK, buttonClickHandler1);
    function buttonClickHandler1(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    butn2.addEventListener(MouseEvent.CLICK, buttonClickHandler2);
    function buttonClickHandler2(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));

  • How do I merge multiple Excel files with more than one tab in each file using PowerQuery?

    Hello
    I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them. 
    I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
    Cheers
    James

    What Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
    When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
    You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
    icon in the header and you'll be done.
    Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
    two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
    let
        Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
        RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
        PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
        ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
    in
        ExpandData

  • How to read a excel file with more than one worksheet.

    Hi,
    I wanna read a sheet (anyone of it,not the first) in a excel.Who can help me!
    best wishes,
    Grant Chen

    Dear All,
    Thank you all for your reply!
    I modified SAP FM ZALSM_EXCEL_TO_INTERNAL_TABLE.
    I add an IMPORTING parameter 'I_SHEET' 
    which stands for the sequence number of worksheet  in the FM.
    FUNCTION ZALSM_EXCEL_TO_INTERNAL_TABLE .
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(FILENAME) LIKE  RLGRAP-FILENAME
    *"     REFERENCE(I_SHEET) TYPE  I
    *"     VALUE(I_BEGIN_COL) TYPE  I
    *"     VALUE(I_BEGIN_ROW) TYPE  I
    *"     VALUE(I_END_COL) TYPE  I
    *"     VALUE(I_END_ROW) TYPE  I
    *"  TABLES
    *"      INTERN STRUCTURE  ALSMEX_TABLINE
    *"  EXCEPTIONS
    *"      INCONSISTENT_PARAMETERS
    *"      UPLOAD_OLE
    *{   INSERT         EC6K900099                                        1
      DATA: excel_tab     TYPE  ty_t_sender.
      DATA: ld_separator  TYPE  c.
      DATA: application   TYPE  ole2_object,
            workbook      TYPE  ole2_object,
            range         TYPE  ole2_object,
            worksheet     TYPE  ole2_object.
      DATA: h_cell        TYPE  ole2_object,
            h_cell1       TYPE  ole2_object.
      DATA:
        ld_rc             TYPE i.
    *   Rückgabewert der Methode "clipboard_export     "
    * Makro für Fehlerbehandlung der Methods
      DEFINE m_message.
        case sy-subrc.
          when 0.
          when 1.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          when others. raise upload_ole.
        endcase.
      END-OF-DEFINITION.
    * check parameters
      IF i_begin_row > i_end_row. RAISE inconsistent_parameters. ENDIF.
      IF i_begin_col > i_end_col. RAISE inconsistent_parameters. ENDIF.
    * Get TAB-sign for separation of fields
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      ld_separator = cl_abap_char_utilities=>horizontal_tab.
    * open file in Excel
      IF application-header = space OR application-handle = -1.
        CREATE OBJECT application 'Excel.Application'.
        m_message.
      ENDIF.
      CALL METHOD  OF application    'Workbooks' = workbook.
      m_message.
      CALL METHOD  OF workbook 'Open'    EXPORTING #1 = filename.
      m_message.
    *  set property of application 'Visible' = 1.
    *  m_message.
    ********************Modified by Grant 20080717************
      call METHOD of application 'Worksheets' = worksheet
      exporting
        #1 = I_SHEET.
      m_message.
      call method of worksheet 'Activate'.
    *  GET PROPERTY OF  application 'ACTIVESHEET' = worksheet.
      m_message.
    * mark whole spread sheet
      CALL METHOD OF worksheet 'Cells' = h_cell
          EXPORTING #1 = i_begin_row #2 = i_begin_col.
      m_message.
      CALL METHOD OF worksheet 'Cells' = h_cell1
          EXPORTING #1 = i_end_row #2 = i_end_col.
      m_message.
      CALL METHOD  OF worksheet 'RANGE' = range
                     EXPORTING #1 = h_cell #2 = h_cell1.
      m_message.
      CALL METHOD OF range 'SELECT'.
      m_message.
    * copy marked area (whole spread sheet) into Clippboard
      CALL METHOD OF range 'COPY'.
      m_message.
    * read clipboard into ABAP
      CALL METHOD cl_gui_frontend_services=>clipboard_import
        IMPORTING
          data                 = excel_tab
        EXCEPTIONS
          cntl_error           = 1
    *      ERROR_NO_GUI         = 2
    *      NOT_SUPPORTED_BY_GUI = 3
          OTHERS               = 4
      IF sy-subrc <> 0.
         MESSAGE a037(alsmex).
      ENDIF.
      PERFORM separated_to_intern_convert TABLES excel_tab intern
                                          USING  ld_separator.
    * clear clipboard
      REFRESH excel_tab.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
         IMPORTING
            data                 = excel_tab
         CHANGING
            rc                   = ld_rc
         EXCEPTIONS
            cntl_error           = 1
    *       ERROR_NO_GUI         = 2
    *       NOT_SUPPORTED_BY_GUI = 3
            OTHERS               = 4
    * quit Excel and free ABAP Object - unfortunately, this does not kill
    * the Excel process
      CALL METHOD OF application 'QUIT'.
      m_message.
    * >>>>> Begin of change note 575877
    * to kill the Excel process it's necessary to free all used objects
      FREE OBJECT h_cell.       m_message.
      FREE OBJECT h_cell1.      m_message.
      FREE OBJECT range.        m_message.
      FREE OBJECT worksheet.    m_message.
      FREE OBJECT workbook.     m_message.
      FREE OBJECT application.  m_message.
    * <<<<< End of change note 575877
    *}   INSERT
    ENDFUNCTION.
    Edited by: Grant Chen on Jul 17, 2008 7:45 AM
    Edited by: Grant Chen on Jul 17, 2008 7:46 AM

  • File with more than one texture

    Hello, I'm having a problem with an animation I am working on. I have a file that contains three sprites on one sheet. What I ususally do it load the sheet onto the stage, then I try and erase the two extra sprites until I need them. Everytime I try it just erases the black background on the previous layer. I've tried switching back to the layer the sprite was on and erasing; but, It still switches to the black background layer and erasies that. I have the sprite sheet in a psd file and I still can't edit it while within the program.

    It is not clear what you mean when you talk about sheets (?) and erasing things - why not just have separate sheets for each ? 
    If you have layers involved and things are on separate layers, then you should be able to lock any layer you do not want to affect.  So you should be able to lock the black background layer and any others except the one you wish to erase.

  • How: can i get a specificated item from a list with more than 100.000 items

    Hi,
    i have a very large list and i got always an exception that the list has more than 5000 items and cant query!! But in the default list view i can see, order and filter all items. So how can i do this by c#?

    Hi,
    According to your description, my understanding is that you want to get a specific list item form a list which with more than 100000 items using C#.
    I suggest you can use CAML Query with some condition and set Row Limit to specify the number of items to return.
    Here is a detailed code demo for your reference:
    Client Object Model Access Large Lists/Overcome ListView Threshold while accessing large list
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Converting document files of more than 100 Mb?

    Is it true that you cannot convert document files with more than 100 Mb to PDFs because of that limit on Adobe CreatePDF?
    Is there a way of solving this problem e.g. document files with 285 Mb?

    have you tried compressing the images in the original document?  You can probably compress to 200 dpi if they are only for printing.

  • Upload Excel file to itab with more than 255 chars

    I want to upload an excel file to internal table with more than 255 characters in one of the field. However it restricts the upload to only 255 characters. Currently I am using the code
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
    i_field_seperator = 'X'
    i_line_header = 'X'
         i_tab_raw_data = wa_tab_raw_data
         i_filename = p_file
      TABLES
         i_tab_converted_data = <fs_table>
      EXCEPTIONS
         conversion_failed = 1
         OTHERS = 2.
    where <Fs_table> is a dynamic structure in which one column is defined as string. We cannot use FM ALSM_EXCEL_TO_INTERNAL_TABLE as it has a restriction of only 50 characters and I dont want to create a Zstruture in the system.

    It wont work for excel file type.However, with FM Gui_Upload and use a text tab-delimited file we can upload long text.
    Here is the code.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = p_files
          filetype                = 'ASC'
          has_field_separator     = 'X'
        TABLES
          data_tab                = <fs_table>
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.

  • Analog Source Triggering with more than one channel in channel list

    Hello,
    I am trying to use an analog reference trigger with a channel list that contains more than one entry using a
    M Series 6289. I am aware that this is generally not possible to have more than one channel in the list due to hardware limitations. I was hoping if some sort of workaround exists.
    I am using the NIDAQmx C API to control the card.
    Using a second card that is syncronized via RTSI should
    allow me to use an analog reference trigger to control multiple analog IO channels ... Right ???
    Thanks for any advice!
    Best regards
    Peter

    Hello Peter,
    If you look at the NI-DAQmx Help, Analog Triggering Considerations for E Series, M Series, and S Series Devices section, it says that to pause multiple channels with an Analog trigger, you must wire that signal to APFI0 or APFI1. Therefore, it is possible to perform this operation.
    If you are sharing the AI Sample Clock across RTSI, then you would be able to stop multiple AI channels across multiple devices with the one Analog Reference Trigger.
    I hope this helps,
    Sean C.

  • Support for file extensions with more than three characters when saving - I want my FLAC!

    Why does the Wave Editor still drop characters from filenames with more than three character extensions when you save a file? But since -opening- a FLAC file with an extension of ".flac" doesn't get chopped to ".fla", why does Audition still chop off the extra character when -saving-?
    It gets old quickly when you have to save, close and reopen files in order to get Audition's Multitrack editor to play nice and be able to find files when you reopen the Session.
    Given that the FLAC filter is open source, I may just have to modify the code and recompile it to force a save to ".fla"... But of course, ".fla" is a Flash file extension, which I also use, so that is a crude hack for me.

    Hi bro...
    use in BYTE mode in place of in TEXT mode. and at the end of each line give some special charactor so as to distinguish between lines.This is effected  by unicode check too
    regards
    Edited by: Mohit Kumar on Feb 9, 2009 9:44 AM

  • DIAdem report with more than 3 signals

    Hi everybody!
    How can I create a report with more than 3 signals  as input. The DIAdem report accepts only 3 signals as Input.
    In my opinion this is an very easy question but I could not solve it during a few hours!
    Thanks in advance,
        Manuel123

    Thank you for your answer!
    But I have still some problems.
    According to your help I have connected eight of the signal-boxes to the connector. After that it is possible to connect up to eight signals to this sub-vi. Great!
    But now I want show all these signals in the Diadem report, for this reason I created a new report-layout (see attachment) and wired the path of it to the "report layout file" - input. Unfortunately Diadem uses still a layout with just two signals and even if I open my own layout in Diadem there are only two data-lines listed in the "Data Portal: Internal Data" - panel.
    Where is my failure?
    Regards,
       Manuel123
    Message Edited by Manuel123 on 08-29-2007 10:00 AM
    Message Edited by Manuel123 on 08-29-2007 10:01 AM
    Attachments:
    man.TDR.zip ‏11 KB

Maybe you are looking for