Share on Google+Share on Google+

Raja Sekhar
Concatenate 2D arrays
1 Answer(s)      5 years ago
Posted in : Java Beginners
JFileChooser jf = new JFileChooser();
jf.setMultiSelectionEnabled(true);
int returnVal = jf.showOpenDialog(frame);
File[] file = jf.getSelectedFiles();

for(int i=0;i<file.length;i++)
    {   
        System.out.println("Iteration number "+i);
        Workbook workbook;
        try {
            workbook=Workbook.getWorkbook(file[i]);
            Sheet sheet=workbook.getSheet(0);
            r=sheet.getRows();
            c=sheet.getColumns();
            for(int k=0;k<c;k++)
            {
                for(int j=0;j<r;j++)
                {
                    Cell a=sheet.getCell(k,j);  
                    arr[k][j]=a.getContents();
                    System.out.println(arr[k][j]);
                }
                System.out.println("\n");
            }  




        }
        catch (BiffException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        catch (IOException e2) {
            // TODO Auto-generated catch block
            e2.printStackTrace();
                        }
}

Ads

View Answers

April 18, 2012 at 3:44 PM











Related Tutorials/Questions & Answers:
Concatenate 2D arrays
Concatenate 2D arrays  JFileChooser jf = new JFileChooser(); jf.setMultiSelectionEnabled(true); int returnVal = jf.showOpenDialog(frame); File[] file = jf.getSelectedFiles(); for(int i=0;i<file.length;i
2d arrays
2d arrays  what is the code for multiplying the values in a 2d array and printing out their sum
Advertisements
How to concatenate two arrays in Java?
How to concatenate two arrays in Java?  How to concatenate two arrays in Java
java 2d arrays
java 2d arrays  Create a program that will: a) Create the array and populate it with the given values. 9, 8 2, 17 49, 4 13, 119 2, 19 11, 47.... and if i do it manualy it is wrong. public class Arrays { public static void main
Java 2D
Java 2D  Hi, What is Java 2D? Thanks   Hi, Please see it at Java 2D API. Thanks
arrays
arrays  using arrays in methods   Java use arrays in methods import java.util.*; class ArrayExample{ public static int getMaxValue(int[] arr){ int maxValue = arr[0]; for(int i=1;i < arr.length;i
arrays
Store a table with students and information (name, ID, password, crypted password, etc) in a multi-dimensional array "stud"  Arrays and Strings: Store a table with students and information (name, ID, password, crypted password
Arrays
Arrays   Hi I need help with the following exercises. Exercise 1: Write a Java application in which the user is prompted for the total number of integer values to be stored in an array. Initialize the array with random values
Arrays
called Rebel.java; 2.Create two arrays. One of them must store integer numbers... the numbers in the second array by 3; 7.Print out the contents of both arrays. 8.Swap
Concatenate two linked lists
Concatenate two linked lists  hello, How to concatenate two linked lists?   hii, You can change null pointer of the first linked list to point the header of the second linked list
SQL Aggregate Concatenate
SQL Aggregate Concatenate         SQL Aggregate Concatenate provides you a concatenated record... Concatenate. To grasp this example, we create a table 'Stu_Table' using
using 2D Array
using 2D Array  Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each student. Assume there are 5 questions in the test. Your program
using 2D Array
using 2D Array  Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each student. Assume there are 5 questions in the test. Your program
Changing 2D graph using slider.
Changing 2D graph using slider.  Code for changing a 2d graph with help of slider
Java Concatenate files
Java Concatenate files In this section, you will learn how to concatenate... is a common task. You can concatenate the file either by using the streams..., you can concatenate number of text files
Java 2D Graphics - Applet
Java 2D Graphics  I am working on GIS project.I want represent a line in different forms like railroad, airplane etc. How can i acheive this I know the standard forms like dashed, dotted line.My code
java 2d graphics - Java Beginners
java 2d graphics  Hello All I need to use 2d graphics in java to build up a map from the given geographic coordinates. What i am not getting is how to scale down these geographic coordinates to device coordinates. I would
Concatenate two pdf files
Concatenate two pdf files       In this program we are going to concatenate two pdf files... Object class.  To make the program for concatenate pdf  files 
Arrays in java
Arrays in java  what is param array in java
PHP Variables Concatenate
PHP Variables Concatenate When we have more than one variable and we want to use those variable in one line or paragraph then we used the concatenate... want to show in one line. For this purpose we used concatenate (dot) to compile
Storing the Color Image pixel values into 2d array
Storing the Color Image pixel values into 2d array  i want to store the color image pixel values into 2d array and agiain the array have to store into a text file using java... plz provide the code
SQL Aggregate Concatenate
SQL Aggregate Concatenate         SQL Aggregate Concatenate provides you... SQL Aggregate Concatenate. To grasp this example, we create a table 'Stu
Selecting elements of 2D array with GUI
Selecting elements of 2D array with GUI  Hello! I am building a Java application with GUI (JFrame form) that is supposed to display all or selected elements of below 2D array (images attached): Year Season 2002 2003
Concatenate Two Strings in java
Concatenate Two Strings in java We are going to describe how to concatenate of two string. we have use for concat() method, this method joints of two string first-to-end. Description of below example:- In this below example we have
java arrays
java arrays  i need a java program to store student details like id,name,addr,marks,average,total..using arrays..input data using scanner class and by using class, object and constructor
java arrays
java arrays  can i know how can we intilize the three dimentional arrays in java? and how can we assign thae values to that array
Java 2D API
Java 2D API       Programming has become more interactive with Java 2D API. You can add images... 2D API. You can easily use 2D within Swing components such as drop shadows
Java with Arrays
Java with Arrays  I was given the assignment to create two parallel arrays; both of size 50 (declares 50 as a constant) One is an array of strings... and store it in the arrays. The input for the problem should be provided in a text
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads