Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

306
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda