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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:37:32+00:00 2026-06-14T02:37:32+00:00

Iam saving JTextArea data in to csv file, but application is not saving the

  • 0

Iam saving JTextArea data in to csv file, but application is not saving the entire data in single cell.

for example:
In JTextArea i added data as below

apple
mango
banana
guava

In .csv file it is saving in four rows instead of single row.

below is my code how iam saving the data.

String address ;
address = textArea.getText();
writer.append(address);
writer.append(',');

Can anyone suggest how to fix the issue?

Thanks

  • 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-14T02:37:33+00:00Added an answer on June 14, 2026 at 2:37 am

    Why not replace the newline characters of the JTextArea with the commas to give you a single CSV row:

    writer.append(address.replace("\n", ","));
    

    Output:

    apple,mango,banana,guava
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to saving an UIImage in PDF file. How can i do this?
I am saving the user image in application domain file system. and the storing
I am saving out and loading mixed data types. I either have the saving
I am saving all the words from a file like so: sentence = fileName
I am saving some pictures on the SD card in this way: File dir
I am saving a single string to a table, it must be unique i
I am saving my data into a dictionary and after saving it to the
I am saving some data in a session, and certain points in my websites,
I am saving my data in the iphone. How could I find the following
I am saving data from Android device to MySQL. My code works fine using

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.