Trying to import from different csv files into multiple JTables

This might seem like something that isn't commonly done, but I'll see if anyone has done this before anyways.
I currently have a JTable (tab #1) and it successfully reads in the data from a CSV file to populate the cells. Now, I am looking into making 3 more JTables. I can tab between the four different tables, but I can't seem to figure out how to get the data to go to the correct JTable. Tab #1 = table, Tab #2 = table2, Tab #3 = table3, Tab #4 = table4.
Thanks.
        try
            FileInputStream fileInput = new FileInputStream ("upcoming.csv");
            BufferedReader InputCSV = new BufferedReader (new InputStreamReader (fileInput));
            line = InputCSV.readLine(); //start reading into the records.
                //Create data for the table.
                //the row variable = starting row
            int row = 0;
            while(line != null)
                tmp = line.split(",");
                for (int col = 0; col < columnNames.length; ++col)
                    data[row][col] = tmp[col]; //store cells' data to the 2-dimensional array.
                row++;
                line = InputCSV.readLine();
            }//end of WHILE-statement.
        } //END of TRY-statement.
        catch(Exception e)
            System.out.println(e);
        }

I have been successful in my quest to get 4 different datasets into 4 different JTables. The previous posters suggestion to use the Table model led me to this page:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/table/TableModel.html
        TableModel myData = new MyTableModel();
        JTable table = new JTable(myData);I had some very similar code in my program. I use the DefaultTableModel and the SortFilterModel before having 4 different JTables.
        DefaultTableModel model = new DefaultTableModel(data, columnNames);
        DefaultTableModel model2 = new DefaultTableModel(data2, columnNames);
        DefaultTableModel model3 = new DefaultTableModel(data3, columnNames);
        DefaultTableModel model4 = new DefaultTableModel(data4, columnNames);I use the code in the first post 4 times, and only change the filename and the data#.
I also have some code that counts the number of lines that will be needed.
Thanks.

Similar Messages

  • How can I import data from a csv file into databse using utl_file?

    Hi,
    I have two machines (os is windows and database is oracle 10g) that are not connected to each other and both are having the same database schema but data is all different.
    Now on one machine, I want to take dump of all the tables into csv files. e.g. if my table name is test then the exported file is test.csv and if the table name is sample then csv file name is sample.csv and so on.
    Now I want to import the data from these csv files into the tables on second machine. if I've 50 such csv files, then data should be written to 50 tables.
    I am new to this. Could anyone please let me know how can I import data back into tables. i can't use sqlloader as I've to satisfy a few conditions while loading the data into tables. I am stuck and not able to proceed.
    Please let me know how can I do this.
    Thanks,
    Shilpi

    Why you want to export into .csv file.Why not export/import? What is your oracle version?
    Read http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php
    Regards
    Biju

  • I am trying to import BPM Project.zip file into Oracle enterpriserepository

    I am trying to import BPM Project.zip file into Oracle enterpriserepository from admin tab.
    I am getting the following exception. please help if any one know the solution.
    Performing import...
    Import Failed: Error [100]: An unknown server-side error occurred. Please record stack trace (if available) and contact technical support.
    com.flashline.exception.LoggableException: trouble parsing file in import bundle: SampleWScall/activityGuide.agdl
         at com.flashline.cmee.openapi.service.subsystem.impexp.XMLTranslator.decode(XMLTranslator.java:157)
         at com.flashline.cmee.openapi.service.subsystem.impexp.ImportJob.doJob(ImportJob.java:74)
         at com.flashline.cmee.openapi.service.subsystem.impexp.AbstractJob.perform(AbstractJob.java:75)
         at com.flashline.cmee.openapi.service.subsystem.impexp.JobThread.run(JobThread.java:41)
    Audit results stored in:
    C:\Users\AVINAS~1.YEL\AppData\Local\Temp\import-4705112223687937017.log
    Audit for [Import job.] created on [2012-09-24 11:53:59 IST].
    2012-09-24 11:53:59 IST - Adding Import job with ID=[50403] to job queue.
    Thanks in Advance.

    Hi
    Why are you trying to import BPM zip file are you trying to configure the out of the box workflows?
    They are something that need to be deployed from the process admin on BPM.
    There would be the .exp file you would need as its BPM 10g that you would need to use.

  • How do i import my local csv files into HANA database as temporary tables  using java program?

    I want to import my local csv file into database for further apply Join with other tables programmatic in JAVA

    Hi Vivek,
    Please go through the following blogs and video to resolve your issue.
    Loading large CSV files to SAP HANA
    HANA Academy - Importing Data using CTL Method - YouTube
    Hope it helps.
    Regards
    Kumar

  • I am trying to import an mp3 audio file into garage band for editing.  drag and drop doesn't work. What now?

    I am trying to import an mp3 audio file into garage band for editing.  Drag and drop does not work. any ideas?

    Try reposting in the Garageband forums. You can find it at:
    https://discussions.apple.com/community/ilife/garageband

  • Import and view CSV Files into OTM

    Hi All,
    Can you please help me in importing CSV files into Oracle Test Manager and to view the imported files in OTM.

    Hi,
    I have just googled and find the link :)
    http://oracleats.com/blog/?p=785

  • Importing CSV files into Multiple Tables in One Database

     I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
    A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
    There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
    in to multiple tables in one database.
    Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
    The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
    I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
    My Concerns/Questions:
    1. Should I create 1 SSIS package or should there be 2, one for each program?
    2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
    folders or when i update an exsisting file?
    Can you provide an example with your suggestion please?
    I greatly appreciate the assistance!
    Y_Tyler

    Hello Vikash,
    Thank you! This will help me get started.
    There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
    paths since there will be two separate folders?
    Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
    Can you help clarify this for me?
    Thank you!
    Y_Tyler

  • How can I import an existing csv. file into Outlook on a Mac with OS10.7

    Tried to import a csv. file on my Mac (OS 10.7.2) into Microsoft Outlook 2011 (for Mac) on the same computer, ended up with a useless Excel page - it opened the csv file in Excel with only a few contacts and uselessly formatted, at that!. Also, tried to save the csv file as a text file, then importing it into Word 2011 and Excel, with the same results. Anyone able to help? Would like to have the contained address/contact info look concise and neat, without duplicates or garbled/missing information.
    [email protected]

    DPS can use H.264 files, but I have no idea about the details since I've never done any of it myself. Ask in the ID/ DPS forums.
    Mylenium

  • Can't paste copied entries from online CSV file into Excel spreadsheet (chatted with zzxc on 5/3/10 at around 2.30 CST but got disconnected. did not get an answer ...)

    Here is the transcript of a chat with Firefox community member zzxcon May 3/10
    You are now chatting with Firefox community member zzxc
    zzxc: Hello
    zzxc: What happens when you attempt to download a .csv file?
    seegal: hello
    seegal: it doesn't copy
    zzxc: how are you trying to copy?
    seegal: pls bear with me I'm a slow typist. Just copy selected text
    Biolizard has joined the conversation.
    zzxc: ok - which text are you selecting?
    seegal: I reconcile my checkbook (spreadsheet this way). I copy the items in my online bank acc and paste it to the spreadsheet
    seegal: I'm using Firefox /2.0.0.19. Have no problem to do this.
    zzxc: Which version of OS X?
    seegal: In all newer version nothing happens when trying to paste- just doesn't paste
    zzxc: Firefox 2.0.0.x is no longer supported, and hasn't been supported in over a year
    zzxc: Paste into Excel, from Firefox?
    seegal: Sorry, I'm ahead... /2.0.0.19
    seegal: Yes. I open my bank acc in Firefox
    zzxc: Which version of Excel?
    zzxc: It would really help if you could tell me step by step what you're doing.
    seegal: First re: your previous question: it's OS 10.4.11
    seegal: About Excell: it'as 2004 version - the lasat one produced for Macs. The specific version is 11.3.7
    seegal: So I open my bank acc online in Firfox (my primary browser). I copy the latest entry in the account and paste it into my Excel spreadsheet.
    zzxc: so, you copy direct from the web page without downloading a CSV file?
    seegal: What do you mean by downloading to CSV file? I could export from the https://chat-support.mozilla.com:9091/webchat/getimage?image=sendmessage&workgroup=support%40workgroup.chat-support.mozilla.comFirefox to the CSV file, but the other way around?
    zzxc: Are you copying your bank statement directly from the web site to Excel using the clipboard?
    seegal: sI don't use the clipboard. This is a mac. There is no need to do that. In PC it would be yes.
    zzxc: I need to know the exact steps you're taking to get them into excel
    zzxc: And I need to know what exactly goes wrong in the latest version of Firefox.
    seegal: Do you have a mac there with Firefox and Excel? It would be very easy to reproduce. Imagine you open an online bank acc, select some entries , click "copy", than proceed to your already open Excel spreadsheet and click' paste". That's it!
    zzxc: When this happens, do you get cryptic code pasted into Excel?
    seegal: As I said before: in all newer versions starting with 3.0 when I go to Excel to "paste" from my bank acc nothing happens. It does not paste. No, I don't get a cryptic code pasted, just NOTHING.
    zzxc: what if you paste into MS Word instead?
    seegal: haven't tried that, the formatting most likely would be lost. Tried that with an other Exc el spreadsheet- it lost all the formating and pasted as continous text.
    == This happened ==
    Every time Firefox opened
    == Pls. see copy of the chat above. THIS A MAC OS X. In older versions, prior to 3.0 I could copy from CSV file on the website Ibank acc) and paste directly to my Excel spreadheet to reconcile my account.

    See also:
    Table2Clipboard: https://addons.mozilla.org/firefox/addon/1852
    TableTools: https://addons.mozilla.org/firefox/addon/2637

  • I wish to import a Bank csv file into my numbers spreadsheet but all of it goes into one column which I can't separate

    I wish to import a csv file from my Bank into a numbers spreadsheet but I can't expand it from the one column it's in . Can anybody help  Thankyou

    This Automator Service (Dropbox download) should do the job, eliminating the need for a trip to TextEdit, etc.
    The one-time installation is simple: just doubleclick the .workflow package. You may have to click "Download Anyway" in System Preferences > Privacy & Security.
    To use, in Finder select the csv file, rightclick, and in Services in the contextual menu select CSV to Tabs on Clipboard. Choose the delimiter when prompted (usually it's a comma but there are other choices). When the "ready to paste" notification appears a few seconds later, click once in a Numbers cell and command-v to paste the data. (If needed Numbers will automatically expand the table to accommodate the data.)
    To remove or rename the Service, in Finder hold down the option key and in the menu Go > Library > Services.
    SG

  • Import very large csv files into SAP

    Hi
    We're not using PI, but have middleware called Trading Networks. Our design is fixed (not my decision) to not upload files into Application Server and import it from there. Our design dictates that we must write RFCs and Trading Networks will call the RFC per interface with very large file sent as table of strings. This takes 14 minutes to import into SAP plain Z-table from where we'll integrate. As a test we uploaded the file to Application Server and integrated into Z-table from there. This took 4 minutes. However our architect is not impressed that we'll stretch available Application Server to it's limits.
    I want to propose that the large file be split in e.g. 4 parts at Trading Networks level and call 4 threads of the RFC which could reduce integration time to e.g. 3 minutes 30 seconds. Is there someone that has suggestions in this regard especially about a proposed, working, elegant solution for integrating large files with our current environment? This will form the foundation of our project.
    Thank you and best regards,
    Adrian

    Zip compression can be tried. The RFC will receive zip stream which will be decompressed using CL_ABAP_ZIP.

  • Import from DVDxDV created file into imovie HD with scene breaks

    I purchased the DVDxDV program and it is working fine importing files from my Sony mini-dvd handycam. When I import the movie file created by DVDxDV into imovie 08, the program seems to automatically create scene breaks (which I want it to do!) However, I would really prefer to use imovie. When I import the DVDxDV created movie file into imovie HD, it comes in as one big video file. I need many, little clips out of this one big file. Is there a way to either import it through DVDxDV with the original scene breaks? Or can I configure imovie HD to behave like imovie 08 and break this big file up? Any help is really appreciated.

    My guess is you'll see the same artifacts using other applications. I do recommend, however, MPEG Streamclip and Miraizon's Cinematize. Those let you select the portions of a video you want to convert so you save a lot of time and hard drive space.
    Also, recent versions of Toast (I don't know if this is true for Toast 7) can export individual chapters from a video DVD or VIDEO_TS folder as separate files. This is done via the Toast Media Browser. Put the VIDEO_TS folder on the desktop or insert the DVD, choose DVD with the top button of the Media Browser. When the item appears in the browser window use the button beneath "DVD" to access the chapter level. Select the chapters you want and drag them to the Video window with DVD video selected as the format. After Toast extracts the split MPEG files you can select them and export them to other formats. It's possible, though, that Toast 7 doesn't have the ability to access the chapter levels.

  • How do I split a Large CSV file into Multiple CSV's Using Powershell

    I am a novice at powershell but this looks to be the best tool to do this task. have a csv file that looks like this:
    Date,Policy,Application
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    Is it possible to split this CSV into multiple CSV's based on "Application".
    Lets say the output might look like:
    None.csv
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    AppBiz.csv
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    PeopleBiz.csv
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    Any help would be greatly appreciated

    I think this might be what you want:
    Import-Csv applications.csv |
    Group Application |
    foreach {
    $_.Group | Export-Csv "$($_.Name).csv" -NoTypeInformation
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Very nice! 4x faster..
    I doubt the OP will get what you just did there..
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • How to import 12 different PPro files into one Encore file to make DVD

    I'm trying to create a DVD with 12 different lessons on it.  I have created 12 Premiere Pro CS4 files (each is a slideshow lessons with narration) and I want to bring them all into one Encore file.  I can send one file to Encore via Dynamic Link - but when I open another PPro file and try to send it to the same Encore folder - it erases the file I put in there previously.  Maybe I'm going about this all wrong - I really don't know.  Please Help.

    Hi Stan,
    Thanks for the reply.
    Since I wanted to get the DVD finished asap - I jumped right into PPro CS4 without going through a learning process first.
    When I said "file" I meant one of the 12 or 13 different PPro projects that I saved to my Desktop...each lesson is different - so I made and saved each lesson separately and placed each of them in a different folder.  Each lesson only has one "sequence" (and I'm not sure what "sequence" means yet).
    These are basically PowerPoint lessons with narration - each lesson containing anywhere from 25-75 pictures or text slides.
    When I opened up one of the lessons in PPro and sent it via DL to Encore - that was fine.  It created an Encore file.  When I opened up the next PPro file and tried to DL to that same Encore file - it appeared to delete or do away with the first file I had sent there.  I could DL each of the 12 or 13 files - but only to its own Encore file.  I couldn't figure out how to get them all into the same Encore file.  But thanks to all the help on this forum - there are now 13 little videos that I can import into the same Encore file.  And that's amazing.
    Thanks for the encouraging words that this project might all fit on the same DVD (I was worred because the files add up to 107 minutes - and I the DVD holds 120 minutes (I think).  I was assuming that after I created a menu and added a picture for the background in the title page, etc., that it would all add up to too much information for one DVD).
    I'll let you know how the DVD turns out.
    Thank you very much.
    ph

  • Trying to import VMDK and VMX files into Oracle VM

    I was given a copy of a VM built in VMWare with the files in VMDK and VMX formats. I've tried various methods of importing these into OVM x86 with no luck.
    According to this 2009 blog post from Oracle it should be possible (at least with that older release):
    https://blogs.oracle.com/virtualization/entry/converting_linux_and_windows_p
    "Oracle VM Manager allows you to import virtual machines in the VMDK format. When you import VMware virtual machines, Oracle VM Manager converts them to Oracle VM virtual machines automatically."
    I'm runninng OVM server/manager 3.1.1. Is this no longer possible with the new version?

    That is correct, that blog post pre-dates OVM 3.1.1 which is a completely different management interface than OVM 2.x used. To my knowledge VMDKs are not supported automatically, and OVM is now expecting OVF/As.

Maybe you are looking for