Multi file reads opinion

What do you think is the best way to read and compare multiple files? At the moment I am in the process of creating a class that does this, and I am reading all the lines of the files into individual collections for each file and then comparing the lines of the collections. Is this a good or bad technique. What would you suggest?
:o)
//Angela

I've been handed this printout of VB code and told to convert it (without even a clue what it does). All I was told is that I need to make this so it can be used by many programs, it'll have to be able to read in any number of files, and files are variable in size (could be a couple hundred lines to a couple million lines). From what I can make out from the code is :
It's taking a substring from each line of one file then searches the other files for that same substring.
I was just wondering if there was a better way of doing this. Because this has got to be very slow for the larger files.

Similar Messages

  • Multi files reading and plotting

    i got three text files to be read  and i wana plot them on a single chart ,how can i do that ?? bundling them??
    And is there any way to write three different values on a single file in three columns ??? i m doing it with matlab ? is there any direct way??

    Hello,
    See if the attached file it's enought.
    For writting the 3 different values in 3 columns, use the "write to spreadsheet file.vi"
    Software developer
    www.mcm-electronics.com
    PS: Don't forget to rate a good anwser ; )
    Currently using Labview 2011
    PORTUGAL
    Attachments:
    Read3files.PNG ‏9 KB

  • How to read multi files?

    Hi !! Can anyone tell me the syntax of reading mulit txt files? Thanks. I only know how to read single file.
    try
    //Search file
    System.out.println(" ");
    System.out.println("Search file :");
    File file = null;
    String fileloc = "c:\\j2sdk1.4.1_06\\bin\\PAYMENT.TXT";
    file = new File(fileloc);
    //If Payment interface file exists
    if (file.exists()) {
    System.out.println("File exists !");
    System.out.println("");
    }

    Hi!! How to read multi files (For example: dbExport1.txt , dbExport2.txt , dbExport3.txt ...... => dbExport*.txt) ?
    I only know how to read a single file.
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         conn = DriverManager.getConnection(url, userid, password);
    stmt = conn.createStatement();
         if (conn != null)
         System.out.println("Connection to Database OK!");
    // read it
    BufferedReader br = new BufferedReader(new FileReader("c:\\document\\dbExport.txt"));
    DataInputStream in = new DataInputStream(new FileInputStream("c:\\document\\dbExport.txt"));
    String input;
    String firstinput;
    String secondinput;
    int count=130;
    int year=1955;
    while ((input = br.readLine()) != null) {
    firstinput = input.substring(0, 10);
    secondinput = input.substring(10);
    count = count + 1;
    System.out.println(firstinput);
    System.out.println(secondinput);
    String insertStore1 = ("INSERT INTO AUTHORS " +
    "VALUES ('" + count + "', '" + firstinput + "', '" + secondinput + "', 1955)");
         System.out.println(insertStore1);
    boolean result;
    if (stmt.executeUpdate(insertStore1) == 1){
    System.out.println("Insertion successful");
    else{
    System.out.println("Insertion failed");
    br.close();
         stmt.close();
         conn.close();
    }

  • Multi-thread file reading

    Hi,
    I've got a tricky question: I have to read large files (over 150 MB) - I found here several topics about reading such a large files, but all examples were about single-threaded reading from file... Do you think, multi-threaded reading would be faster? I am in quite a dilemma: multiple threads in general means faster processing, but in this case, all threads are reading from the same source/file
    (I use javax.mail.util.SharedFileInputStream for multi-threaded file reading - each stream in separated thread)
    so what do you think, which is faster: single-thread or multiple-thread? and if so, how many threads would be fine - 2, 3 or 4?
    thanks a lot

    kvasoo wrote:
    Herko_ter_Horst wrote:
    The I/O thread processing thread(s) approach will work when the processing takes more time than the I/O (i.e. when the medium can transfer information faster than a single thread can process it).it is very likely that processing will take more time then file reading - there will be 5-7 regex to match per line, sometimes object creation and filling object fith some data
    so it seems to be just like I wrote some posts before: while one thread is reading data from file, another could process already read data - I am just considering malcolmmc's idea of blocking queue - one thread to perform I/O operations and one thread to process data - these threads would be connected through blocking queue....hmm that sounds good to me.. thanks malcolmmc
    thank you guys for your help & suggestions and if you still have something to advise me, I will be thankfulSeparation of concerns, dude. Read the raw data in, in one thread, and split out the processing to multiple threads. I really advise you take the time to actually measure the performance of the multi-threaded processing vs the single-threaded one though. I mean, really do actually do that. Don't just assume - as so many people do - that throwing more threads at every problem will always speed it up, because it's so often not the case.

  • T510 Windows XP 64bit - Multi Card reader no longer working

    Just installed XP 64 bit from XP 32 because i finally got tired of windows only recognizing 2GB of RAM.
    I have just discovered the multi card reader no longer works (it worked just a few days ago with the 32 bit xp).
    i have tried uninstalling and reinstalling the driver (6hss03ww.exe - Ricoh Multi Card Reader Driver) several times, with no luck.
    i do not have any uninstalled drivers, or highlighted items in the device manager.
    Has anyone else ever has this issue, or can offer some advice? i am a bit at a loss... and ready to dump this thing out the window and buy a mac...

    Hello mate,
    Lenovo doesn't support windows xp 64-bit. If you have a look in the readme file it says
    Added support for Microsoft Windows XP Professional x64 Edition (on ThinkPad
    W510 only).
    Install windows vista or 7 if you want a 64-bit OS.
    Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information on it.
    ThinkPad T510 4313-CTO Windows 8 x64 - Intel Core i7-620M - NVIDIA NVS 3100M - 8GB RAM - 240GB SSD- Intel Centrino Ultimate-N 6300 - Gobi 2000.
    ThinkPad Helix 3697-CTO Windows 8.1 x64 - Intel Core i7-3667U - Intel HD Graphics 4000 - 8GB RAM- 256GB SSD - Intel Centrino Advanced-N 6205 - Ericsson C5621gw

  • Problem with Multi File upload example, help needed

    I got the code from the following location.....
    http://www.adobe.com/devnet/coldfusion/articles/multifile_upload.html
    And I've got it to work to some degree except I cant get the file transfer to work when pressing, Upload.   Below is what my debugger outputs.  Any thoughts on how to fix this or even what it means?
    At the very bottom of this message is the upload.cfm code.......
    Thanks in advance for the help
    <html>
    <head>
      <title>Products - Error</title>
    </head>
    <body>
    <h2>Sorry</h2>
    <p>An error occurred when you requested this page.
    Please email the Webmaster to report this error.
    We will work to correct the problem and apologize
    for the inconvenience.</p>
    <table border=1>
    <tr><td><b>Error Information</b> <br>
      Date and time: 12/07/09 22:25:51 <br>
      Page:  <br>
      Remote Address: 67.170.79.241 <br>
      HTTP Referer: <br>
      Details: ColdFusion cannot determine how to process the tag &lt;CFDOCUMENT&gt;. The tag name may be misspelled.<p>If you are using tags whose names begin with CF but are not ColdFusion tags you should contact Allaire Support. <p>The error occurred while processing an element with a general identifier of (CFDOCUMENT), occupying document position (41:4) to (41:70).<p>The specific sequence of files included or processed is:<code><br><strong>D:\hshome\edejham7\edeweb.com\MultiFileUpload\upload.cfm      </strong></code><br>
      <br>
    </td></tr></table>
    </body>
    </html>
    <!---
    Flex Multi-File Upload Server Side File Handler
    This file is where the upload action from the Flex Multi-File Upload UI points.
    This is the handler the server side half of the upload process.
    --->
    <cftry>
    <!---
    Because flash uploads all files with a binary mime type ("application/ocet-stream") we cannot set cffile to accept specfic mime types.
    The workaround is to check the file type after it arrives on the server and if it is non desireable delete it.
    --->
        <cffile action="upload"
                filefield="filedata"
                destination="#ExpandPath('\')#MultiFileUpload\uploadedfiles\"
                nameconflict="makeunique"
                accept="application/octet-stream"/>
            <!--- Begin checking the file extension of uploaded files --->
            <cfset acceptedFileExtensions = "jpg,jpeg,gif,png,pdf,flv,txt,doc,rtf"/>
            <cfset filecheck = listFindNoCase(acceptedFileExtensions,File.ServerFileExt)/>
    <!---
    If the variable filecheck equals false delete the uploaded file immediatley as it does not match the desired file types
    --->
            <cfif filecheck eq false>
                <cffile action="delete" file="#ExpandPath('\')#MultiFileUpload\uploadedfiles\#File.ServerFile#"/>
            </cfif>
    <!---
    Should any error occur output a pdf with all the details.
    It is difficult to debug an error from this file because no debug information is
    diplayed on page as its called from within the Flash UI.  If your files are not uploading check
    to see if an errordebug.pdf has been generated.
    --->
            <cfcatch type="any">
                <cfdocument format="PDF" overwrite="yes" filename="errordebug.pdf">
                    <cfdump var="#cfcatch#"/>
                </cfdocument>
            </cfcatch>
    </cftry>

    Just 2 things in my test:
    1) I use no accept attribute. Coldfusion is then free to upload any extenstion.
    Restricting the type to application/octet-stream may generate errors. Also, it is unnecessary, because we perform a type check anyway.
    2) I have used #ExpandPath('.')#\ in place of #ExpandPath('\')#
    <cfif isdefined("form.filedata")>
    <cftry>
    <cffile action="upload"
                filefield="filedata"
                destination="#expandPath('.')#\MultiFileUpload\uploadedfiles\"
                nameconflict="makeunique">
            <!--- Begin checking the file extension of uploaded files --->
            <cfset acceptedFileExtensions = "jpg,jpeg,gif,png,pdf,flv,txt,doc,rtf"/>
            <cfset filecheck = listFindNoCase(acceptedFileExtensions,File.ServerFileExt)/>
    <!---
    If the variable filecheck equals false delete the uploaded file immediatley as it does not match the desired file types
    --->
            <cfif filecheck eq false>
                <cffile action="delete" file="#ExpandPath('.')#\MultiFileUpload\uploadedfiles\#File.ServerFile#"/>
                <cfoutput>Uploaded file deleted -- unacceptable extension (#ucase(File.ServerFileExt)#)</cfoutput>.<br>
            </cfif>
    Upload process done!
            <cfcatch type="any">
                There was an error!
                <cfdocument format="PDF" overwrite="yes" filename="errordebug.pdf">
                    <cfdump var="#cfcatch#"/>
                </cfdocument>
            </cfcatch>
    </cftry>
    <cfelse>
    <form method="post" action=<cfoutput>#cgi.script_name#</cfoutput>
            name="uploadForm" enctype="multipart/form-data">
            <input name="filedata" type="file">
            <br>
            <input name="submit" type="submit" value="Upload File">
        </form>
    </cfif>

  • Memory Card "Stuck" in A720 multi-card reader

    This is an embarrassing situation. Really appreciate if someone can give me some idea.
     I just got the A720 for a few days. I used SD cards fine with A720's multi-card reader, but last night when I (gently as with the SD cards) slotted in a regular Sony memory stick in it (6-in-1, accepting MS/ MS Pro), the whole stick moved beyond the opening and well into the slot. The A720 could detect the card and I immediately copied all the file into the HD and ejected it on Windows.
    Now the memory stick  remains in(side) the card reader slot, and I dare not touch it further lest it goes further inside. Is this a design flaw? I was appalled and am frustrated by how this could have happened -- I actually used my little finger to slot the card in!. I bought the A720 mainly for photo post-processing.
    Any idea I can get the stick out (and even better slot it in without the same happening again)? Thank you.

    Hi
    Welcome To Lenovo Community
    There are various reason for a memory card to get stuck inside the card reader
    Most common is the direction in which the card is inserted, size of the card also matters or any obstacle which is their inside the card reader.
    Push a little harder on the card and it might pop out. The spring mechanism on the inside is designed to release once it is pushed past a certain point.
    If this doesn't work, you need to force it out using a flat tool. To do so Turn off your system , Press  the Power Button for 15 seconds to drain out the remaining charge
    Now use a  needle nose pliers, areal long thin one. And gently pull the memory card out.
    You can also try using a paper clip apply  glue on the edge. Very tiny amount that won't drip push clip in and touch the back of the card. Wait until it is hard in about 15 secs and pull the card out.  
    if this does not work contact Local Lenovo service center , we need to open the card reader to remove the memory card
    Hope This Helps
    Cheers!!!
    Important Note: If you need help, post your question in the forum, and include your system type, model number and OS. Do not post your serial number.
    Did someone help you today? Press the star on the left to thank them with Kudos!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!  This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Automating multi-file Flash using XML file "run list"

    I've created a multi-file interactive Flash "demo" for a client. It's very much like a website (though he's not using it as a website) in the way that it is laid out in that there is a main index page which can then direct you to different product categories, which you can click on to see. Each "page" contains product (or product category) information, photos, block diagrams, etc. There is nothing animated in the Flash.
    My client also wants to be able to set it up so that the demo runs automatically from a configurable XML file. My ActionScript skills are pretty limited, but I've been able to using ActionScript 3 to load and read the XML file. Using a 'for' loop, I am able to read the XML file and return the path of each Flash file and the duration that each file should be displayed (my client requested that he be able to configure the duration of each page as well).
    I've set up a loader for each movie clip and a timer for the display duration. Unfortunately, the thing that is throwing me off is that when I attempt to load the movie clip (as the last item in the for loop), it reads the entire XML file, returns all of the clips and durations (I'm using trace to see this) before it loads the movie clip. As a result, the only movie clip that is loaded is the last one read from the XML file.
    As I said, I'm not very good at ActionScript, so everything that I've managed to cobble together has been from internet tutorials.
    This is my code:
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    var mcLoader:Loader = new Loader();
    mcLoader.contentLoaderInfo.addEventListener(Event.INIT, playClip);
    var mcCurrent:MovieClip = new MovieClip();
    stage.addChild(mcCurrent);
    var xml:XML;
    function playClip(e:Event):void
        trace("Function:playClip");
        stage.removeChild(mcCurrent);
        mcCurrent = MovieClip(mcLoader.content);
        mcLoader.unload();
        stage.addChild(mcCurrent);
    function xmlLoaded(e:Event):void
        trace("Function: xmlLoaded");
        xml = new XML(e.target.data);
        var cl:XMLList = xml.clip;
        for(var i:uint=0; i<cl.length(); i++)
            trace("Begin 'for' loop");
            trace("variable 'i' is" + i);
            var clipPath = cl[i].@path;
            var delay = cl[i].@duration;
            trace("Clip path is " + clipPath);
            trace("Display for " + delay);
            mcLoader.load(new URLRequest(clipPath));
    xmlLoader.load(new URLRequest("filerunlist.xml"));
    I removed the timer event because it, like everything else was getting repeated before anything got loaded, so I wanted to figure out out to get the clip loader (mcLoader) to load the movie clip for each file before I figured out where to put the time to ensure that each clip is displayed for the appropriate duration. I suspect that the timer event needs to occur in the 'playClip' function, but would take advice on that as well.
    Thanks to anyone that can help me figure this out.

    What you need to do in the xml parsing function is to simply store all of the data into an array.  You will then use that array one element after another via whatever timer control you set up, accessing each file in the order they are stored in the array.  You will not do any loading in that function, just data storage, and when you are done, the last line in that function, outside of the loop, will trigger whatever function you have that will start processing the first item in the array.
    Example, storing data objects in the array...
    var clipData:Array = new Array();   // store your xml data here
    var clipToShow:uint = 0;                   // use this later in the showClip function
    function xmlLoaded(e:Event):void
        trace("Function: xmlLoaded");
        xml = new XML(e.target.data);
        var cl:XMLList = xml.clip;
        for(var i:uint=0; i<cl.length(); i++)
            clipArray.push( { clipPath: cl[i].@path, delay: cl[i].@duration } );
        showClip();
    function showClip(){
         // do whatever to process loading clipArray[clipToShow].clipPath
         // and using clipArray[clipToShow].delay for starting whatever timer is involved
         // the timer event handler function will call this function when it is executed
         clipToShow += 1;   // increment the counter for the next clip in line
    If you are not comfortable/familiar with the object approach, then you could also store the clip and delay data in two separate arrays.

  • RFC to multi file scenario

    Hi,
    I have to carry out a RFC to multi-file scenario. The requirement is that Error generating on whatever part XI will handle have to be reported. Is this possible in this scenario? What can be the mechanism?
    I want to report these errors via a mail to an e-mail id.
    Since i haven't done this scenario, i would appreciate if some link for carrying this out step-by-step is given.Also tell me what configuration for receiving RFC has to be done on XI and R/3.

    Hi Arpit
    <b>go through these blogs for the querry</b>
    <b>For email alerts</b>
    /people/aravindh.prasanna/blog/2005/12/24/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-2
    /people/aravindh.prasanna/blog/2006/02/20/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-3
    /people/sap.user72/blog/2005/01/14/alert-management--improving-monitoring-of-your-landscape
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    You have to do SMTP Configuration for EMail and SMS.....
    http://help.sap.com/saphelp_nw04/helpdata/en/af/73563c1e734f0fe10000000a114084/content.htm
    Thanks !!

  • For some reason FCP is now making multi files when I capture called -av

    For some reason FCP is now making multi files when I capture called -av
    I capture one clip but I get 7 files.
    sineparade live-1-av 1.91 GB
    sineparade live-2-av 1.91 GB
    sineparade live-3-av 1.91 GB
    sineparade live-4-av 1.91 GB
    sineparade live-5-av 1.91 GB
    sineparade live-6-av 334.1 MB
    sineparade live-av 1.91 GB
    I don't know why this started in recent captures but it is eating up disk space as it is 7 times larger than it needs to be and only the last one works.

    Is there a way to get these files to be joined together into one file easily. I capture on a FAT32 hard drive but then transfer the files onto my edit machine and would prefer to keep everything archived there as a single file.
    Any programs or scripts that I can use. I have figured out that you can open each file in Quicktime and then save as a self contained file, but I was wondering if there is a better way.

  • How to upload multi files in struts

    Hi all,
    plz show me how to upload multi files in struts ... :(
    thank in advance.
    bowlkhin

    [help link 1|http://www.roseindia.net/struts/strutsfileuploadandsave.shtml]
    [help link 2|http://www.roseindia.net/struts/strutsfileupload.shtml]

  • Multi File Find and Replace FAR missing from tools

    I have RoboHelp x5.0.2 and I have always used Find and
    Replace at my previous employer. I have started with a new company
    and the RoboHelp FAR is missing from Tools. I know you can Add a
    tool if you know the path, but I have no idea where to look.
    Some background:
    We use Source Safe (VSS) to check our files in and out.
    I have verified that all of the files are NOT read-only.
    HELP!!!!

    Maybe you are mixing up something. RoboHelp includes a tool
    named Multi-File Find and Replace. This should indeed be situated
    on the Tools pane.
    There exists a tool called FAR, which, among other things,
    offers a similar functionality. FAR is shareware and
    not included in RoboHelp.
    Greetings
    ---Dirk Bock

  • Can't upload multi file in ovi share

    Hello, why I can't find the button to upload multi file in ovi share now?  Help me, please!

    Today i had the same problem, i've tried Firefox, Explorer and Chrome without solution.
    At the moment, the only way is to use Nokia Ovi Suite.

  • Multi File upload

    I want to develop a functionallity for MultiFile Upload, is it directly supported in JSF 2.2 or i have to use some other implementation of JSF such as RichFaces or ICEFaces.

    Hello,
    Why don't you just make a portal form for them ?
    Making a portal form based on the table (the one holding the BLOBs)
    will generate multi files upload automatically
    Is this what u need ?

  • Attaching multi files to javamail?

    Am trying attach multi files to a javamail, but when I do javamail sends the last file multi times? Somehow it copies the last file to the other files and sends it multi times. This how I do:
    MimeBodyPart textPart = new MimeBodyPart();
    textPart.setContent(body,"text/plain");
    Multipart mp = new MimeMultipart();
    MimeBodyPart attachFilePart = new MimeBodyPart();
    for(int i=0;i<filListe.size();i++)
    File vedhaeftetFil = (File)filListe.get(i);
    FileDataSource fds = new FileDataSource(vedhaeftetFil);
    attachFilePart.setDataHandler(new DataHandler(fds));
    attachFilePart.setFileName(fds.getName());
    mp.addBodyPart(attachFilePart);
    System.out.println(fds.getName());
    mp.addBodyPart(textPart);
    msg.setContent(mp);
    Transport.send(msg);
    Can someone tell me how I can solve this?

    lol....
    MimeBodyPart textPart = new MimeBodyPart();
    textPart.setContent(body,"text/plain");
    Multipart mp = new MimeMultipart();
    MimeBodyPart attachFilePart;
    for(int i=0;i<filListe.size();i++)
    File vedhaeftetFil = (File)filListe.get(i);
    attachFilePart = new MimeBodyPart();
    FileDataSource fds = new FileDataSource(vedhaeftetFil);
    attachFilePart.setDataHandler(new DataHandler(fds));
    attachFilePart.setFileName(fds.getName());
    mp.addBodyPart(attachFilePart);
    System.out.println(fds.getName());
    mp.addBodyPart(textPart);
    msg.setContent(mp);
    Transport.send(msg);

Maybe you are looking for

  • Multiple Windows for Multiple Files using Reader 7.0.9

    Install used to be able to double click on PDFs and open each on in their own window from My Computer using Windows XP Pro SP2. This morning, each file double clicked opens in the same Reader window. In our environment the apps our locked down so the

  • How do you set up a TIME-LAPSE movie "before" putting into CS5 ??

    Is there a way to put together a time-lapse sequence shot with a DSLR (comprised of many stills) into a movie at 30fps, BEFORE putting it into the Adobe Premiere Pro CS5 timeline? QuickTime does NOT work because the images I need to use are TIFFs of

  • Error message [261]

    Every time I try to burn a CD from an iTune playlist the CD ejects itself and up pops this message: The attempt to burn disc failed. An unknown error occurred [261]. Can anyone please explain this? Thanks.

  • Updating from Lightroom 4 to Lightroom 5?

    I upgraded from Lightroom 4 to Lightroom 5 in November. I then ignored Lightroom 5, left it on my desktop and continued downloading images into Lightroom 4. Now I would like to start using Lightroom 5, but of course all the images that I downloaded s

  • Mac book and iphoto

    I've made an new album on my new MacBook , but now when i want to play the dia slideshow it is the other way around starting the slide show with the last dia/photo of the album instead of the first photo of my created album. Is there any easy way to