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 8944019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:55:46+00:00 2026-06-15T11:55:46+00:00

In my file writer, I have these codes, the j == 4 and j

  • 0

In my file writer, I have these codes, the j == 4 and j == 8 is to execute a different code for the column that contains numbers

for(int i=0; i<model.getRowCount();i++){
        for(int j=0; j<model.getColumnCount();j++){
            if(j==4 || j==8){
                excelWriter.write("\""+model.getValueAt(i, j) + "\t"+"\""); 
            }
            else{
                excelWriter.write(model.getValueAt(i, j) + "\t");
            }
        }
        excelWriter.write("\n");
    }

the problem is after that column with number had been printed, the next column will not be printed.. for example

This is my JTable

| texta | textb | textc | textd | number | texte | textf | ....... 

in the excel file, it will be printed as....

| texta | textb | textc | textd | number | textf | ....... 

it skips the column beside the column with number…

when i remove the 2nd “\” in the code, the rest of the column concatenate to the column with number.

Any idea how could I fix this?
Thanks in advance

  • 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-15T11:55:47+00:00Added an answer on June 15, 2026 at 11:55 am

    The second \ have to be written before \t I would guess.

    Wait… I have created an Excel sheet with text columns and number columns. Then I exported that sheet to a tab separated file. When I open that file in a text editor the number isn’t escaped on any kind. So I don’t think you need this if.

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

Sidebar

Related Questions

I have a chunk of code that does a file put operation inside a
I have an Item Writer as below: <beans:property name=lineAggregator> <beans:bean class=org.springframework.batch.item.file.transform.FormatterLineAggregator> <beans:property name=fieldExtractor> <beans:bean
I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0)
I'd like to execute JavaScript code from within a C# assembly and have the
I have writen the following code but when i execute him i get this
I have the most basic PHP code with just these 13 lines: <!DOCTYPE html>
I have a php script whose name is XYZ.php. When I load that file
This is the code I have, but the file is a little smaller and
hey there guys and girls i have this code that should download a json
I am trying to query a database. I already have a file that includes

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.