What is the wildcard code..?

i am writing a program. I want the program to search for all files that end with one extension, and i want it to rename it to another extension...
example
test.java -------> test.dat
(not to encode it.)
ok... i have the actual rename done, but how do i get it to do all files that end with the extension?
here is pretty much the bulk
File z = new File("dv.txt");
z.renameTo(new File("dv.dat"));
that little excerpt renames the file, but how do i get it to do all (filename).txt to (filename).dat with in a directory?
Thank you!

Create a File instance for the directory.
File directory = new File("C:\\MyDirectory\\");Create a FilenameFilter that will only accept files with the extension you want.
FilenameFilter filter = new FilenameFilter() {
    public boolean accept(File dir, String name) {
        return name.matches("*.txt");
};Use listFiles(FilenameFilter) to get an array of File objects that represent every file in the directory that has a name with that extension.
File[] filesToRename = directory.listFiles(filter);Then iterate over the array changing each file.

Similar Messages

  • Can we create a developersite in O365 SP Online programiatically ? what is the template code for it ?

    Hi
    I am trying to create sites programmatically in O365 SharePoint Online. So, just want to know that can we create a DeveloperSite ?? what is the template code for it viz. Team site- STS#0, etc
    If possible provide me the MSDN link where I can refer for available site templates for O365 SP Online sites creation.
    Thank you 

    http://community.office365.com/en-us/f/154/t/61145.aspx
    Are you meaning to create sites on SharePoint Online by invoking web services in your own program? SharePoint Online indeed provide some web services for custom programming, however, the web methods for creating a new site seems not included in them. Here
    are some resources for the development of SharePoint Online for your reference:
    SharePoint Online for developers
    http://msdn.microsoft.com/en-us/sharepoint/gg153540.aspx
    Code example for SharePoint Online: Accessing Web Services
    http://code.msdn.microsoft.com/office/SharePoint-Online-0bdeb2ca
    As to create a site collection, the parameter "Template" is the name of the template you want to use, as to find the name of the custom site template, you can use the powershell command "Get-SPOWebTemplate",
    it will list all the templates with the names.
    Note, The Template and LocaleId parameters must be a valid combination as returned from the Get-SPOWebTemplate cmdlet.
    Also check
    http://stackoverflow.com/questions/21268629/creating-new-site-collection-in-office-365-from-an-app
    If this helped you resolve your issue, please mark it Answered

  • What are the transaction codes we use for LSMW in MM, SD, PP  & FI/CO gnrly

    Hi all,
    What are the transaction codes we use for LSMW in MM, SD, PP  & FI/CO generally?
    Help will be surely rewarded.
    Thanks and Regards,
    Creasy

    > What are the transaction codes we use for LSMW in MM, SD, PP  & FI/CO generally?
    General threads about LSMW in MM, SD, PP, FICO will be locked and deleted generally.
    > Help will be surely rewarded.
    &********************** Please read "the rules" if found usefull... ************************&
    Cheers,
    Julius

  • What are the T-codes that contain the master data for material and vendor?

    what are the T-codes that contain the master data for material and vendor?

    hi ,
    - Display Material  tcodes...
    MM01 - Create Material
    MM02 - Change Material
    MM03 - Display Material
    MM50 - List Extendable Materials
    MMBE - Stock Overview
    MMI1 - Create Operating Supplies
    MMN1 - Create Non-Stock Material
    MMS1 - Create Service
    MMU1 - Create Non-Valuated Material
    ME51N - Create Purchase Requisition
    ME52N - Change Purchase Requisition
    ME53N - Display Purchase Requisition
    ME5A - Purchase Requisitions: List Display
    ME5J - Purchase Requisitions for Project
    ME5K - Requisitions by Account Assignment
    MELB - Purch. Transactions by Tracking No.
    ME56 - Assign Source to Purch. Requisition
    ME57 - Assign and Process Requisitions
    ME58 - Ordering: Assigned Requisitions
    ME59 - Automatic Generation of POs
    ME54 - Release Purchase Requisition
    ME55 - Collective Release of Purchase Reqs.
    ME5F - Release Reminder: Purch. Requisition
    MB21 - Create Reservation
    MB22 - Change Reservation
    MB23 - Display Reservation
    MB24 - Reservations by Material
    MB25 - Reservations by Account Assignment
    MB1C - Other Goods Receipts
    MB90 - Output Processing for Mat. Documents
    MB21 - Create Reservation
    MB22 - Change Reservation
    MB23 - Display Reservation
    MB24 - Reservations by Material
    MB25 - Reservations by Account Assignment
    MBRL - Return Delivery per Mat. Document
    MB1C - Other Goods Receipts
    MB90 - Output Processing for Mat. Documents
    MB1B - Transfer Posting
    MIBC - ABC Analysis for Cycle Counting
    MI01 - Create Physical Inventory Document
    MI02 - Change Physical Inventory Document
    MI03 - Display Physical Inventory Document
    MI31 - Batch Input: Create Phys. Inv. Doc.
    MI32 - Batch Input: Block Material
    MI33 - Batch Input: Freeze Book Inv.Balance
    MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
    MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
    MIQ1 - Batch Input: PhInvDoc. Project Stock
    MI01 - Create Physical Inventory Document
    MI02 - Change Physical Inventory Document
    MI03 - Display Physical Inventory Document
    MI31 - Batch Input: Create Phys. Inv. Doc.
    MI32 - Batch Input: Block Material
    MI33 - Batch Input: Freeze Book Inv.Balance
    MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
    MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
    MIQ1 - Batch Input: PhInvDoc. Project Stock
    MI01 - Create Physical Inventory Document
    MI02 - Change Physical Inventory Document
    MI03 - Display Physical Inventory Document
    MI31 - Batch Input: Create Phys. Inv. Doc.
    MI32 - Batch Input: Block Material
    MI33 - Batch Input: Freeze Book Inv.Balance
    MICN - Btch Inpt:Ph.Inv.Docs.for Cycle Ctng
    MIK1 - Batch Input: Ph.Inv.Doc.Vendor Cons.
    MIQ1 - Batch Input: PhInvDoc. Project Stock
    MI21 - Print physical inventory document
    MI04 - Enter Inventory Count with Document
    MI05 - Change Inventory Count
    MI06 - Display Inventory Count
    MI09 - Enter Inventory Count w/o Document
    MI34 - Batch Input: Enter Count
    MI35 - Batch Input: Post Zero Stock Balance
    MI38 - Batch Input: Count and Differences
    MI39 - Batch Input: Document and Count
    MI40 - Batch Input: Doc., Count and Diff.
    MI08 - Create List of Differences with Doc.
    MI10 - Create List of Differences w/o Doc.
    MI20 - Print List of Differences
    MI11 - Physical Inventory Document Recount
    MI07 - Process List of Differences
    MI37 - Batch Input: Post Differences
    for vendor..
    XKN1  Display Number Ranges (Vendor)
    XK01  Create vendor (centrally)
    XK02  Change vendor (centrally)
    XK03  Display vendor (centrally)
    XK04  Vendor Changes (Centrally)
    XK05  Block Vendor (Centrally)
    XK06 Mark vendor for deletion (centrally
    XK07  Change vendor account group
    XK11  Create Condition
    XK12  Change Condition
    XK13  Display Condition
    XK14  Create with cond. ref. (cond. list)
    XK15  Create Conditions (background job)
    reward points if useful,
    venkat.

  • What is the T.code in SAP R/3 for SAP console applications

    sequence picking in Hall 52. Batch number 0017137168 was assigned to 2 associates. 
    One  associate was assigned to the picks and the other associate confirmed the TO'S
    This is requirement by client
    What is the T.code in SAP R/3 for SAP console applications

    hall 52

  • Hi what is the transaction code for vendor master delete

    hi
       what is the transaction code for vendor master delete? and customer master delete?
    thank u
    surya

    Hi
    There won't be any Deleting of customer and vendor completely
    we only BLOCK them
    FK05                   Block Vendor (Accounting)
    MK05                   Block Vendor (Purchasing)
    XK05                   Block Vendor (centrally)
    FD05                   Block Customer (Accounting)
    VD05                   Customer Block (Sales)
    XD05                   Block customer (centrally)
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • HT1918 what is the postal-code for lebanon ? I cand find it :(

    what is the postal-code for lebanon ? I cand find it

    From a quick search, some of the results that I've found seem to imply that Lebanese addresses can have postal codes, which consist of 8 numbers - the first 4 for the region, the second 4 for the building. Are you being forced to enter a post code ?
    What sort of visa card are you trying to add, debit or credit ? If it's a debit card then I don't think that they are still accepted as a valid payment method - they are not listed on this page and there have been a number of posts recently about them being declined
    If it's a credit card then is it registered to exactly the same name and address (including format and spacing etc) that you have on your iTunes account, it was issued by a bank in your country and you are currently in that country ? If it is then you could check with the card issuer to see if it's them that are declining it, and if not then try contacting iTunes support and see if they know why it's being declined : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management

  • Hi, for stastical postings any report available in sap what is the t.code

    hi
    Hi, for stastical f-38/f-55 postings any report available in sap what is the t.code
    sd/-
    Sreenivas.P

    Hiii srinivas
    statistical posting means " Noted items" which can give only information regarding without any accounting documents like " Bank Guarantees and Payment Requests like that..
    u can get the details for vendors in FBL1N by the selection of "Noted items " and same for customers in FBL5N and for GL Accounts in FBL1N
    I hope it will helps u
    plss reward the points if it is useful
    regard
    ramki

  • What are the wildcards for FILE_MASK in FM EPS_GET_DIRECTORY_LISTING

    The wildcard for exactly 1 character is '?'.
    example: with mask ????????.STA     , I get the following files:
    BWMDAACW.STA
    BWMDAADW.STA
    BWMDAAEW.STA
    BWMDAAFW.STA
    BWMDAAGW.STA
    (all files ending with .STA, with 8 characters before .STA)
    But what is the wildcard for 'any character' ?
    I tried with *.STA     , but the result is
    test1
    test2
    test3
    test4
    y5c01
    (all the filenames with exactly 5 characters)
    with *STA, the result is
    IBAN
    PBCL
    rfbi
    stxh
    stxl
    (all the filenames with exactly 4 characters)
    (the result is the same with *123 or *XYZ !!!)
    with BW*, the result is
    BWMDAACW.STA
    BWMDAADW.STA
    BWMDAAEW.STA
    BWMDAAFW.STA
    BWMDAAGW.STA
    as expected, but * seems the right wild character for 'any character' only at the end of the mask; it seems not work as expected when it is not the last character of the mask.
    It seems very strange! What are the rules for wildcards ? (I'm in 4.7)
    thanks in advance

    CONSTANTS DAYS1980     TYPE I VALUE 3652.
    DATA: linelength TYPE i VALUE 0.
    DATA: linelength1 TYPE i VALUE 0.
    DATA: text TYPE string.
    DATA: DLIST    LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
          DPATH    LIKE EPSF-EPSDIRNAM,
          PFILE    LIKE EPSF-EPSFILNAM,
          MDATE    LIKE SY-DATUM,
          MTIME    LIKE SY-UZEIT,
          POINT_IN_TIME TYPE I.
    DATA: BEGIN OF FATTR OCCURS 0,
              FILE_NAME  LIKE EPSF-EPSFILNAM,
              FILE_SIZE  LIKE EPSF-EPSFILSIZ,
              FILE_OWNER LIKE EPSF-EPSFILOWN,
              FILE_MODE  LIKE EPSF-EPSFILMOD,
              FILE_TYPE  LIKE EPSF-EPSFILTYP,
              FILE_MTIME(12),
          END OF FATTR.
    PARAMETER P_PATH(50) TYPE C DEFAULT '/TMP' LOWER CASE.
    PARAMETER P_FILE(50) TYPE C DEFAULT ' '  LOWER CASE.
    DPATH = P_PATH.
    PFILE = P_FILE.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
         EXPORTING
              DIR_NAME               = DPATH
    *          FILE_MASK              = PFILE
         TABLES
              DIR_LIST               = DLIST
         EXCEPTIONS
              INVALID_EPS_SUBDIR     = 1
              SAPGPARAM_FAILED       = 2
              BUILD_DIRECTORY_FAILED = 3
              NO_AUTHORIZATION       = 4
              READ_DIRECTORY_FAILED  = 5
              TOO_MANY_READ_ERRORS   = 6
              EMPTY_DIRECTORY_LIST   = 7
              OTHERS                 = 8.
    break developer.
    IF SY-SUBRC EQ 0.
      LOOP AT DLIST.
      linelength = STRLEN( DLIST-NAME ).
        linelength = linelength - 3.
      linelength1 = STRLEN( P_FILE ).
        linelength1 = linelength1 - 3.
      if DLIST-NAME+linelength(3) = P_FILE+linelength1(3).
        CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
             EXPORTING
                  FILE_NAME              = DLIST-NAME
                  DIR_NAME               = DPATH
             IMPORTING
                  FILE_SIZE              = FATTR-FILE_SIZE
                  FILE_OWNER             = FATTR-FILE_OWNER
                  FILE_MODE              = FATTR-FILE_MODE
                  FILE_TYPE              = FATTR-FILE_TYPE
                  FILE_MTIME             = FATTR-FILE_MTIME
             EXCEPTIONS
                  READ_DIRECTORY_FAILED  = 1
                  READ_ATTRIBUTES_FAILED = 2
                  OTHERS                 = 3.
        IF SY-SUBRC EQ 0.
          FATTR-FILE_NAME = DLIST-NAME.
          APPEND FATTR.
        ENDIF.
        endif.
      ENDLOOP.
      SORT FATTR BY FILE_NAME.
      LOOP AT FATTR.
        POINT_IN_TIME = FATTR-FILE_MTIME.
        CALL FUNCTION 'POINT_IN_TIME_CONVERT'
             EXPORTING
                  POINT_IN_TIME = POINT_IN_TIME
             IMPORTING
                  DATE          = MDATE
                  TIME          = MTIME
             EXCEPTIONS
                  OTHERS        = 1.
        SUBTRACT DAYS1980 FROM MDATE.
        WRITE: / FATTR-FILE_NAME,
                 FATTR-FILE_SIZE,
                 MDATE,
                 MTIME.
      ENDLOOP.
    ENDIF.
    Edited by: kk.adhvaryu on Sep 25, 2010 12:08 PM

  • What is the ok code for Save (to post a document)

    Hi all Technos
    How to post a document(Save it) in BDC In Tr Code F-02 after all entry? What is code for that.
    In simple what is the ok code for SAVE. For your kind infromation ENTER is not taking.
    Plz any body help me For that.
    Every usefull answer will be rewarded with points..
    Thanks in advance
    shovan

    Hi Shovan,
    OK-code for save is =BU
    Check this recording..Award points if useful
    perform bdc_dynpro      using 'SAPMF05A' '0100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BKPF-BLDAT'
                                  '06.05.2008'.
    perform bdc_field       using 'BKPF-BLART'
                                  'SA'.
    perform bdc_field       using 'BKPF-BUKRS'
                                  'BP01'.
    perform bdc_field       using 'BKPF-BUDAT'
                                  '19.05.2008'.
    perform bdc_field       using 'BKPF-MONAT'
                                  '5'.
    perform bdc_field       using 'BKPF-WAERS'
                                  'USD'.
    perform bdc_field       using 'FS006-DOCID'
    perform bdc_field       using 'RF05A-NEWBS'
                                  '40'.
    perform bdc_field       using 'RF05A-NEWKO'
                                  '630020'.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  '100'.
    perform bdc_field       using 'BSEG-MWSKZ'
                                  'I0'.
    perform bdc_field       using 'BSEG-TXJCD'
                                  'ca0000000'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-KOSTL'
                                  '1201'.
    perform bdc_dynpro      using 'SAPMF05A' '0700'.
    perform bdc_field       using 'BDC_OKCODE'
                                  *'=BU'.* 
    Thanks,
    Rvaee..

  • What is the procedure/code in VBA for passing the calc scripts dynamically based on the selection.

    Hello Gurus,
    I want to know what is the procedure/code in VBA for passing the calc scripts dynamically based on the selection.
    For example:
    X=EssVCalculate("Sheetname","Calc_Script name",True)
    In the above code instead of the *"Calc_Script name"* I want a script which is called dynamically and the values are calculated accordingly.
    Thanks in advance
    Saurabh

    Hi Todd,
    This is the situation:
    I have a calc script in Essbase which I can call to perform the calculations on the current sheet that is retrieved. I want calculation for the following formulas:
    x = EssVCalculate("Sheet2", "CalcBC", False)
    CalcBC is my calc script which is present in Essbase
    So instead of passing the above script I want to pass the conditions dynamically in the VBA code . I don't want to mention the script name directly in EssVCalculate option
    For example:
    I have three drop down menus from which I would select three different( zero level )members. It would then retrieve the data for that particular values in the excel sheet and now when I click on Calculate button it should calculate the script dynamically.
    I don't know how calc scripts can be executed dynamically in the VBA code itself.
    Thanks in Advance
    Saurabh

  • What is the process code for Message type FUNDMA

    Hi,
    I am sending CO elements to the distributed server using ALE. Can somebody tell me what is the process code for the message type FUNDMA?
    Thanks
    William

    Check entries of table VEDI_TMSG1. This contains Message types and associated Process codes.
    Hope this helps.
    ashish

  • What is the process code for message type FIXEDASSET_CREATE?

    Hi all
    please tell me that what is the process code for
    MESSGAE TYPE = FIXEDASSEt_CREATE,
    FUNCTION MODULE = IDOC_INPUT_FIXEDASSET_CREATE,
    BASIC TYPE = FIXEDASSET_CREATE01 ?
    thanx in advance.......
    Edited by: Prachi Sharma on Jan 11, 2008 7:45 AM
    Edited by: Prachi Sharma on Jan 11, 2008 8:03 AM

    Hi,
    Check the Tcodes WE41 and WE42 for Outbound and Inbound process codes
    Check below Tables as well
    EDE1T
    EDE2T
    EDE5T
    EDE6T
    TEDE5
    TEDE6
    Regards,
    Satish

  • What is the transaction code for see the Web Services available in SAP

    Hi
    I came to know that SAP has provided its own webservices... I need some information on that... If any one has documentation on that can u please send it to me... My ID is <b>[email protected]</b>.
    What is the trasaction code for see the web services available in SAP.... Can any one help.. Please its  urgent
    Best Regards
    Ravi Shankar B
    Message was edited by:
            RaviShankar B

    Hi,
    you can find Web Services (Enterprise Services) in the Enterprise Services Workplace (ES Workplace). The ES Workplace allows you to explore, test, and use enterprise services to make enterprise SOA tangible. Here, you will find all of the currently productized enterprise services by SAP.
    Best Regards,
    Boris Mueller
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/developerareas/esa/esapreview">ES Workplace at SDN</a>
    <a href="http://esapreview.sap.com:82/socoview(bD1kZSZjPTgwMCZkPW1pbg==)/flddisplay.asp">ES Workplace</a>

  • What is the t-codes for transport Organizer

    what is  the t-codes for transport Organizer

    STMS - and with SE16, Table TSTCT you can look up any other transaction code in R/3.
    Rgds.

Maybe you are looking for

  • Unable to reinstall ORDS Beta 3.0 after uninstalling it

    Tried to reinstall ORDS Beta 3.0 after uninstalling it but got below error. Pls provide clean steps to reinstall. Thx. java.lang.reflect.InvocationTargetException         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.r

  • Error during approval Process flow in Process controlled workflow

    Hello Experts, We are in SRM 7.0 classic scenario using Process controlled workflow.WE recently connected a new backend R/3 system to our SRM system i.e we now have 2 R/3 backend system connected to SRM system It is regarding the two new additional a

  • Find the column name for a constraint

    Hi Guru, I know the constraint name, now i need the column name and table name for the constraint? Thanks

  • Human resource

    Hi,   what are the infotypes used with PCH logical database please mention them with their prefix

  • Browser "Back" button - can it be disabled or detected when pushed?

    Is there any way to disable the back button in the browser or detect when it is pushed and redirect the application to a different page rather than moving back to the previous page? Specifically for IE6 & IE7. Edited by: burferd on Jun 25, 2008 11:01