Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

305
Views
how can we create excel sheets where each sheet contains data from a given number of text files in the form of rows and columns

in my program first i have written a function to count sheets to be created according to the number of text files data to be inserted in the excel file then a function which counts rows in each text file and finally a function that counts number of columns by using StringTokenizer method countTokens then i have passed these values in the below method....but the code is not working properly as the number of sheets it creates is less than the number of text files and data in the sheets is not inserted appropriately

void store(int sheetnum, int rows, String filename, int columns) {
    String datafile = filename;
    FileReader fr = new FileReader(datafile);
    BufferedReader in = new BufferedReader(fr);
    String data = in.readLine();
    for (int i = 0; i < sheetnum; i++) {
        while (data != null) {
            HSSFSheet sh = HSSFWorkbook.createSheet(i);
            for (int j = 0; j < rows; j++) {
                HSSFRow row = sh.createRow(j);
                for (int k = 0; k < columns; k++) {
                    // createcell
                    // setcellvalue
                }
                data = in.readLine();
            }
        }
    }
}
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!