Problem about locating file with similar filename "Info_*.dat"

Dear all,
I am a big problem in file locating and reading, please help and greatful to reply me with sample code.
How can I locate and read in files with similar file name ( Info_*.dat ) one-by-one. For example , Info_AAA.dat, Info_BBB.dat, Info_CCC.dat. I want to read in Info_AAA.dat first, and then Info_BBB.dat , and lastly Info_CCC.dat, where AAA, BBB and CCC are random number. These files are stored in the same directory.
How can I make use of * ? such as Info*.dat . Is that possible to use * with java ? Please show me a sample if possible.
help Help..Urgent !
Thanks a lot.
MRW.

That's easy with PathPattern class from JRegex:
import java.util;
import jregex.util.io.PathPattern;
  Enumeration files=new PathPattern("Info_*.dat").enumerateFiles();
  while(e.hasMoreElements()){
     File f=(File)e.nextElement();
     doWhatever(f);
...There are also any-char "?" and any-directory "**" wildcards.
See http://jregex.sourceforge.net/gstarted.html#filesystem

Similar Messages

  • Copy a file with same filename using XI - module experts please help!

    Guys,
    Felix Jeyareuben had an excellent blog on how to copy a binary file with XI.
    /people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi
    It is a shame by the way that such a simple thing has to be this complicated in XI, but that's another question...
    So after I created the EAR file and successfully deployed the modules on our XI server, I got the following file adapter error, when I was trying to use it:
    Sender Adapter v2727 for Party '', Service 'BS_TA_XI_DEV':
    Configured at 2006-11-30 14:04:15 EST
    History:
    - 2006-11-30 14:10:00 EST: Error: java.lang.ClassCastException
    - 2006-11-30 14:10:00 EST: Processing started
    Can you give me any clues what could have gone wrong?
    This is the first module I deployed so I might have messed up something simple, but I cannot figure this out.
    Also how can I debug this?
    Your help would be much appreciated.
    Thanks a lot,
    Viktor Varga

    > Moorthy,
    > My issue is not so much about the filename, but an
    > encrypted (binary) file that I just want to copy from here to there.
    Do it like in the mentioned blog, but don't do any mapping. That will be fine.
    > Michal,
    > In my adapter I have the following:
    > 1)  localejbs/xi_file_module/ReadBinaryBean
    >  (LocalEnterpriseBean)
    > )  localejbs/CallSapAdapter
    >                         (LocalEnterpriseBean)
    > ine.xml file I have this:
    > <enterprise-bean>
    >   <ejb-name>ReadBinaryBean</ejb-name>
    > <jndi-name>xi_file_module/ReadBinaryBean</jndi-name>
    >   <session-props/>
    > enterprise-bean>
    Check your EAR if there are any libs from the adapter framework and delete them if necessary.
    After deployment check in your visual administrator if your EAR is available.
    Regards
    Stefan

  • Problem opening PDF files with adobe

    I cannot get adobe to open my pdf files. Not from internet nor from desktop.
    I downloads fine,. I have installed and reinstalled several times.
    If I try to open it looks like it opens but closes immediately. I tried to open adobe, but nothing. A grey screen and that's it. I cannot access the help button

    Yes, I finally got it working using number 2:-) Thank you very much
    2013/8/1 Pat Willener <[email protected]>
       Re: Problem opening PDF files with adobe  created by Pat Willener<http://forums.adobe.com/people/pwillener>in
    Adobe Reader - View the full discussion<http://forums.adobe.com/message/5557146#5557146

  • Problem about .xml file from PPro CS5 to FCP with RED and P2 file.

    I have create a Project in Premiere Pro CS5.
    I import the RED file R3D or P2  file XMF and editing my media.
    From menù File i select Export to "Final Cut Pro XML.."
    I open FCP and Import file XML but the media are not reconnect.
    "Warrnig: Non-critical error were found while processing an XML document.
    Would you like to see a log of these error now?"
    I want see the log file and...
    "<file>: Unable to attach specified media file to new clip."
    Where is the problem?

    Hi Dennis I re-format my MACPRO 8 Core and I installed Final Cut Studio Suite and CS5 Premium (no CS4)
    I install Blackmagick driver Decklink 7.6.3
    If I open the After Effects  and setting preview card blackmagic, I see the preview in external monitor.
    If I open the Premiere Pro and setting preview, I don't see the blackmagic card but the second monitor, DV....etc.
    In Premiere I see the blackmagic preset, but no the preview card.
    I have a second question.
    About Red file I want editing in Premiere Pro and i whant color correct in Apple Color from FCP.
    My problem is: my color program crash when I send file form FCP to Color (random mode)
    The sequence is:
    I import file red in PPro5 -- editing file --- export file xml.
    Close the PPro5.
    Open FCP import xml (no re-link media)
    Save de project in FCP
    Select sequence and send to Color.
    In this moment the Apple Color crash.
    I shutdown the MAC.
    I power-up the MAC
    Open FCP select the project and send the sequence to Color.
    Color see the project but no media.
    I re link the media and I editing in color my media.
    Why Apple Color program crash?
    Sorry for my English
    Many Thanks
    Distinti saluti
    Gianluca Cordioli
    Alchemy Studio'S di Gianluca Cordioli
    Via Pacinotti 24/B
    37135 VERONA
    cell.:+39 3385880683
    [email protected]
    www.alchemystudios.it

  • Opening a file with its filename from a servlet- avoid buffer to cach files

    Hi,
    I am building an URL with the following code and calling that particular file from this servlet using request dispatcher. When I am geting alcCode from getParameter method then it is not caching the pages
    but when I am geting the same through a session value it starts caching the page after cirtain number of requests and shows up the previously requested file.
    I guess it is because it always names the file with the package name.
    for example if my package is sree then the file opened is named as
    sree[1].pdf. Please help me solve this problem
    alcCode = req.getParameter("alcList");
    HttpSession userSession= req.getSession(false);//if request is from //submit action from a FORM
    String alcCode;
    alcCode = req.getParameter("alcList");
    System.out.println("request.getparameter alcCode "+alcCode);
    if (alcCode==null){
    alcCode= (String) userSession.getValue("alcCode");
    //else get the alc code from the session that has been stored
    Calendar todaysDate=Calendar.getInstance();
    int selectMonth=todaysDate.get(Calendar.MONTH);
    int selectYear=todaysDate.get(Calendar.YEAR);
    if(selectMonth <10)
    //selectMonth = InvoiceDate.substring(1,i-8);
    urlPdf="/reports/RPTS"+selectYear+"0"+selectMonth+"/PDF-FORMAT/E"+selectYear+"0"+selectMonth+"_"+alcCode+".PDF";
    }else{
    urlPdf="/reports/RPTS"+selectYear+selectMonth+"/PDF-FORMAT/E"+selectYear+selectMonth+"_"+alcCode+".PDF";
    res.setContentType("application/pdf");
    res.reset();
    res.resetBuffer();
    res.setHeader("Content-disposition","attachment; filename" +urlPdf );
    System.out.println(urlPdf);
    try{
    ServletContext sc = getServletContext();
    RequestDispatcher rd = sc.getRequestDispatcher(urlPdf);
    rd.forward(req, res);
    Thanks in advance.
    -Sreekanth Varidhireddy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I had a similar problem when I used the attachment argument to the Content-Disposition header.
    try replacing this:
    res.setHeader("Content-disposition","attachment; filename" +urlPdf );
    with this:
    res.setHeader("Content-Disposition","inline; filename=" +urlPdf );
    /Niklas

  • CFContent open file with # in filename

    I am trying to launch a file when the user clicks on a link. Sometimes the filename has a # sign in the name, like "My File #1.xlsx". When they click it, they get an error saying "The file specified in the contentTag does not exist" and then the shows .../My File not found.
    Additionally, though I can't remember for sure at the moment, I think I've had trouble with a few other characters such as  ^, *, ?, ", <, >, |. And consecutive periods (.) like My...Filename.xlsx. However, I can live with that problem but not the # in the filename!
    Surely there's something I can do to launch such a file.
    Here's what I'm using:
    this is the call: <td><a href="./fileopener.cfm?attached_file=true&file_location=#qryGetFileNames.ServerDirectory# \#qryGetFileNames.ServerFile#">#qryGetFileNames.ServerFile#</a></td>
    <cfset file_location = "#url.file_location#">
    <cfheader name="content-disposition" value="attachment;filename=#file_location#">
    <cfcontent deleteFile="no" file=#file_location# reset="yes">
    Thank you.

    Have you tried escaping the # ?
    #replace(file_location,"#","##","all")#
    OR
    In the URL: #URLEncodedFormat(qryGetFileNames.ServerFile)#
    ^_^

  • [File] Problem while creating files with long pathnames

    Hello everybody
    I'm trying to create File objects corresponding to physical files. These files have very long pathnames because they are located in directories tree with large depth. So, my pathname conatins a lot of directories plus the name of the file itself.
    It seems, that there is a limitation in the length of the pathname that I pass to the File constructor because files with small pathnames are OK bu the ones with very large pathnames cannot be created.
    I tried the different File constructors (File(String pathname) and File(File parent, String childname)) but it still does not work. Even if the second constructor is a little bit better as it succeeds on files where the first constructor failed. But still, it's not enough.
    Please Help!
    Thank you
    Hugo

    RESOLVED!
    The problem was from the OS itself (Windows XP) which accepts at most 255 characters long path names.

  • FTP-Sender Adapter ignores files with "known filenames"

    Hello experts,
    the scenario is FTP -> XI -> IDOC and we have problems with the polling of the files. In communication channel monitoring everything is working fine, but in the FTP folder some files are ignored, although the communication channel is set up for all *.txt-files.
    My question is, is it possible that the FTP sender adapter ignores files, if it already has processed a file with the same filename? After renaming the files they all were picked up and archived into another folder. How can I configure the communication channel to pick up ALL *.txt-files in the out-folder?
    Best regards
    David

    Hi David,
    What I have observed is, XI always reads files in a certain order (possibly alphabetical or reverse alphabetical). If it finds a file in the source directory that already exists in the archive directory, it will not attempt to read/process the next file (even if the next filename is completely new).
    So, if any of the files in the source directory exist in the archive directory, there is a possibility that certain files may get processed and certain wont.
    Make sure that none of the files that you put in source directory exist in the archive directory (i.e. all the files are new) and see the output. Let me know if this helps.
    PS: I used FTP protocol
    Regards,
    Riyaz

  • Problems running jsp files with tags on tomcat 4.0

    hi,
    i had some jsp1.1 stuff running on tomcat3.3.
    last week i moved to tomcat 4.0 , changed the tags to fit jsp1.2 and... everything is wrong now. while trying to run jsp with tags i get an error message (same for all files):
    ---->
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: (class: org/apache/jsp/djsp$jsp, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )V) Incompatible object argument for function call
    <-------
    the jsp files with no tags and servlets are running ok.
    I NEED YOUR HELP!!!

    cyclid,
    i have the same environment setup and the same troubles. after searching the forums, it seems that there are others with the same, if not similar issues, yet no solutions. if you find the solution to this one, could you please post it. i would really appreciate it since i have been on this one for several days with no success. i even tried the helloworld jsp/custom tag examples from a jsp profession book that i have and that won't work.
    Anyone out there,
    if you have any idea why this problem exists, any solutions, ideas would be appreciated.
    thank you,
    navesink

  • XFA form with button to save file with unique filename

    Is there a way to save a file with a unique filename using some data a user has entered (name, for ex.) that will fire when the user clicks a Print button? Attached is a file for reference.

    Yes, I'm getting close. With this
    var 
    vTargetName = Page1.dateStamp.rawValue + " HSS Foot & Ankle for Patient " + Page1.First_Name.rawValue + " " + Page1.MI.rawValue + " " + Page1.Last_Name.rawValue + ".pdf";
    var  
    vCurrentName = event.target.documentFileName.toString(); 
    if  
    (vCurrentName == vTargetName)app.alert("Thank you. Your form has been saved."); 
    else
    app.alert("There was a problem. Your form has not been saved.");
    I do get an alert when the PDF is saved. But if I modify the folder js to say var vPath = "/c/HSS/ instead of var vPath = "/c/HSSSave/ I don't get the alert "There was a problem." Do you see an error in the else condition?

  • Problem opening pdf files with Adobe Reader in Windows 7

    I bought a new Dell (Inspiron 5110) with pre-installed Windows 7 Home Premium (Version 6.1 SP1, 64 bit) and pre-installed Adobe Reader X (10.1.1). I cannot open ANY of my old pdf files with the Adobe reader (even after I re-installed the Adobe Reader). On another computer with Windows 7 I get the same error message. When I installed several other pdf-readers (Sumatra, Foxit, ..) I can still not open the pdf's -- but all the pdf's still open under Windows XP on my old computer and they also open on all my colleagues' non-Windows 7 computers. So it appears to be a Windows 7 problem. The Adobe error message says 'Adobe Reader could not open _.pdf because it is either not a supported file type or because the file has been damaged (…..).
    N.B.: I can download pdf files from the internet and can then open these 'new' pdf files with Adobe Reader X.
    N.B.2.: Most of the 'old' pdf files are scientific articles downloaded from various journal websites 2002-2011, so their quality should be out of question.
    N.B.3.:I've transfered the files via memory stick and portable HD.
    N.B.4.: If I try to open the pdf's via 'Open with' the problem remains the same.
    N.B.5.: When, on my Win7 Dell, I've uploaded/attached one of these old pdf files to an email the rtecipient could not tead it. But he could read it when I'd sent the same file from my old Win XP computer.
    N.B.6.: I have repeated this last observation: When I upload an old pdf file on my Win7 Dell to my email account and then send it to myself, I cannot open/read it on my Win XP (nor on the Dell, of course). Although the file size is precisely the same.
    N.B.7.: When I download a new pdf on my Dell, then upload/attach it to an email also on the Dell and send it to myself, I can download and read the attached pdf on both computers.
    Would be grateful for any suggestions.

    This is really strange.
    Please correct me if I am wrong, but from what I can understand, any PDF which is launched on your Win 7 OS fails to open, even though the same file works perfectly fine on your Win XP machine?
    Could you please run a full system anti virus scan on the said PDFs that are present on your local system. It could be a case of infected PDFs.
    Also, it would be great if you could try and download some of the erroneous PDFs from the web again, and see if you experience the same behavior.
    Thanks
    Ankit

  • Export query results to flat file with dynamic filename

    Hi
    Can anybody can point me how to dynamic export query serults set to for example txt file using process flows in OWB.
    Let say I have simple select query
    select * from table1 where daterange >= sysdate -1 and daterange < sysdate
    so query results will be different every day because daterange will be different. Also I would like to name txt file dynamicly as well
    eg. results_20090601.txt, results_20090602.txt, results_20090603.txt
    I cant see any activity in process editor to enter custom sql statment, like it is in MSSQL 2000 or 2005
    thanks in advance

    You can call existing procedures from a process flow the procedure can create the filename with whatever name you desire. OWB maps with file as target can also create a file with a dynamic name defined by an expression (see here ).
    Cheers
    David

  • How to export file with original filename number suffix, but with more digits

    Is there a way to keep the original filename number suffix, but change the formatting of the number, adding leading zeros for instance?
    When I import photos from my camera I like to rename them, and give them sequential numbers, e.g. "2015-01 Hamburg 1.cr2", "2015-01 Hamburg 2.cr2", "2015-01 Hamburg 10.cr2", .. "2015-01 Hamburg 134.cr2", and so on.
    Normally when I export photos I like to keep the file names exacly as I imported them (except the extension) e.g. 2015-01 Hamburg 1.jpg, "2015-01 Hamburg 2.jpg", .. "2015-01 Hamburg 10.jpg", .. "2015-01 Hamburg 134.jpg".
    But sometimes I would like to export them with leading zeros, typically when adding photos to a web site or blog where there are sort mechanisms that only support simple sort algorithms based on file names, meaning the sort order of my photos with their original file names would become "2015-01 Hamburg 1.jpg, "2015-01 Hamburg 10.jpg", .. "2015-01 Hamburg 134.jpg", "2015-01 Hamburg 2.jpg".
    So I would like the file names to be "2015-01 Hamburg 001.jpg", "2015-01 Hamburg 002.jpg", "2015-01 Hamburg 010.jpg", "2015-01 Hamburg 134.jpg".
    By keeping the original file number suffix I can easily go back to the original file whenever I need to, and the sort order would work even with simple sorting.
    The export Filename Template Editor gives quite advanced support for numbering files when exporting, see attached screenshot. There's support for exporting files with custom file names, and adding sequence, total and image number with padding (up to 9999/####). But those add new numbers, they do not consider the original filename number suffix. If I use the "Image # (001)" for instance, my example above would export as "2015-01 Hamburg 001.jpg", "2015-01 Hamburg 002.jpg", "2015-01 Hamburg 003.jpg", "2015-01 Hamburg 004.jpg", if those were the four photos I wanted to export, making it hard for me to trace them back to the original photo.
    I have found no way of adding such padding on the original file number.
    Does anyone know if this is possible or have suggestions for a workaround?
    It shouldn't be too hard for Adobe to support this I'd imagine.
    export pattern rename files  file_number filename_template_editor

    I do not know if you can do what you explained above, but there is a workaround to this (and a way to avoid having to do it in the future):
    In the Library module, make sure your images are sorted by Capture Date (this will put them in the right order, even with suffixes like 1, 13, etc.)
    Select all images, and then Rename them, using a Custom text followed by a Sequence number. The Custom text in this case should be the original name (such as, 2015-01 Hamburg, as in your example). Make sure the Sequence number is formatted with enough zeroes to include all the numbers in your images.
    In the future, when you rename images during Import, make sure you select the Sequence number format that will include all the needed zeroes, so you don't have to go through this again.

  • Problem saving fdf file with a file extenstion

    When I download a file with a 'FDF' extension, the file contains the name of the PDF template to be used. Preview or ADOBE is supposed to get the PDF and populate it with the data in the FDF file. This works fine with Firefox and IE under Windows, but in Firefox on the MAC the FDF file is saved without an extension. If I rename if to whatever.fdf, it works like it's supposed to.
    Does anyone know why the OS is not saving the FDF file with an extension?

    No, the value of the /F key in the FDF dictionary (which is what FDFSetFile sets) must be a file specification. See the PDF Reference for more information about file specifications.
    George

  • New problem opening Pagemaker files with InDesign

    I have quite a lot of archive files made in Pagemaker 6 and 7 and now use InDesign CS2. Until recently I could open pagemaker files from InDesign then save them as InDesign files and away I went.
    But now I am just getting an error message saying the document is damaged and cannot be recovered. First off I thought it really was a damaged document but then realised all my old .pmds were saying the same.
    Is there a known issue maybe with a recent upgrade of InDesign or something?
    I would really love to be able to access my old pmds!!
    Thanks in anticipation.

    Yes Joel you're right - XP and recently installed SP3.
    Just pondering the best way forward.
    I'm responsible for the IT for a small charity with 8 staff members.
    I have Master Suite CS3 and use a variety of the programmes but the other staff members are only using InDesign and MS Office.
    We're not a high end design set up but producing all the sort of leaflets, posters bits and pieces that we need day to day. 
    Decided to upgrade to Office 2010 and to do that I had to install SP3.
    Stuck with ID2 for everyone else (and went to great lengths to buy some extra licenses to do so) because opening an ID2 file with ID3 creates a new file which is a big nuisance and it's expensive to upgrade across the board (even with charities having access to educational licensing concessions).
    Fact of life is we do tend to have quite long-lived files and I will go on wanting to open pagemaker ones for some time to come.
    I probably only want to convert a pmd once a month I guess - it's just suddenly a huge nuisance not to be able to do those few ...
    I can't roll back to SP2 because of Office 2010.
    I could re-set one workstation wtih XP2, Office XP and InDesign CS2 purely to be able to convert pmds. Again, nuisance and ties up a licence on a little-used machine.
    I could bite the bullet and move everyone over to InDesign CS3 - will I definitely be able to open pmds from there?
    Ah, just thought - I have an ID3 licence but not loaded on my computer. If I load that and use it just for opening pmds then export them for backwards compatibility with ID2 like this http://livedocs.adobe.com/en_US/InDesign/5.0/help.html?content=WSa285fff53dea4f86173837510 01ea8cb3f-6d4d.html will I then be a happy bunny?
    Would be glad of expert comment before I start faffing about!
    Thanks

Maybe you are looking for

  • Why don't these videos show up in Final Cut Pro X?

    Okay so I am very new to my iMac and to using final cut pro for editing. I have been using Premiere Pro for a while so im not new to this type of software. However i cannot work out why Final Cut Pro won't show me the video to these clips. It plays t

  • Quick drop window issue

    The Quick Drop window is now expanded (see below) and I don't know how to return to its original size. What should I do ? Message Edité par chilly charly le 08-31-2008 04:29 PM Chilly Charly    (aka CC)          E-List Master - Kudos glutton - Press

  • Premier elements 11 install stops/fails

    I have installed PSE 11 OK, but PRE 11 install fails at the "Configuring Windows Installer" phase.  There is no error message;  the install just seems to stop.   There is no log file.  I'm running Windows 8 64-bit.  PSE 9 and PRE 9 are still both OK,

  • Safari cant upload/download files, other browsers crash

    MY Ipad 3th generation can't upload or download any files in Safari From the new Ios 8. This have nothing to do with Safari because other browsers like Chrome crash directly if you want to upload a file from your photo library. This all happened afte

  • Flash and Shockwave crash all my browsers

    Hi I have suddenly started having a problem, everytime i try and do something such as play a youtube video, or view a website with flash content, I get a message saying explorer/chrome/firefox has encountered a problem and needs to close...however wh