Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8185829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:59:06+00:00 2026-06-07T01:59:06+00:00

package jexcel.jxl.nimit; import java.io.File; import java.io.IOException; import jxl.Cell; import jxl.CellType; import jxl.LabelCell; import jxl.Sheet;

  • 0
package jexcel.jxl.nimit;  

import java.io.File;  
import java.io.IOException;  

import jxl.Cell;  
import jxl.CellType;  
import jxl.LabelCell;  
import jxl.Sheet;    
import jxl.Workbook;  
import jxl.read.biff.BiffException;  
import jxl.write.Label;  
import jxl.write.WritableSheet;  
import jxl.write.WritableWorkbook;  
import jxl.write.WriteException;  


public class ExcelJxl {

    public static void main(String[] args) throws WriteException, IOException,     BiffException{
        String S="D:\\nimit.xls";
        ExcelJxl.WriteFile(S);
    }
    public static void WriteFile(String path) throws IOException, WriteException, BiffException{
            Workbook wb=Workbook.getWorkbook(new File(path));
           Sheet sheet=wb.getSheet(0);
            String s1=null;
            String s2=null;
            Cell c1=sheet.getCell(0,0);
            Cell c2=sheet.getCell(1,0);
             if (c1.getType() == CellType.LABEL)
            {
              LabelCell lc = (LabelCell) c1;
               s1 = lc.getString();
            } 
            if (c2.getType() == CellType.LABEL)
            {
          LabelCell lb = (LabelCell) c2;
           s2 = lb.getString();
        }
        String s3=s1+s2;

    WritableWorkbook copy=Workbook.createWorkbook(new File("D:\\demo.xls"),wb);
    WritableSheet Wsheet = copy.getSheet(0); 
    Label l1=new Label(0,0,s1);
    Wsheet.addCell(l1);
    Label l2=new Label(1,0,s2);
    Wsheet.addCell(l2);
    Label l3 = new Label(2, 0,s3);
    Wsheet.addCell(l3);
    copy.write();
    copy.close();
 }
}

I’m trying to learn how to read and write to the same Excel file.

I’m taking two strings from one file and putting in the other.

How to put the content into the same file?

I’m creating a new file and then I’m putting the contents.
How to read and write to the same text file?
How to overcome this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:59:08+00:00Added an answer on June 7, 2026 at 1:59 am

    read-write lock: http://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

package jexcel.jxl.nimit; import java.io.*; import jxl.Cell; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; import jxl.read.biff.File;
package com.test.methods; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException;
package mp1practice; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.logging.Level;
package src; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Command { public static
package com.crumbin.tabs; //java package import java.io.IOException; import java.util.ArrayList; import org.json.JSONException; import android.app.Activity; import android.app.AlertDialog;
package net.learn2develop.PopularAttractions; import java.io.IOException; import java.util.List; import java.util.Locale; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController;
package mp1similar; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.StringTokenizer;
package mp1similar; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.StringTokenizer;
package macroreader; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class MacroReader { public static
package jtextareatest; import java.io.FileInputStream; import java.io.IOException; import javax.swing.*; public class Jtextareatest { public static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.