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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:29:26+00:00 2026-06-06T01:29:26+00:00

I have a simple java code that reads text csv file that contains sentences

  • 0

I have a simple java code that reads text csv file that contains sentences with double quotations: “sentence1″,”sentence2″,”sentence3”. I want to read some of these sentences(e.g, sentence 1 and 3). I created a buffer reader and used readLine() then used: tokens = fileLine.split(","); where tokens is an array of strings.

I accessed the sentences I’m interested in using the array index as: tokens[0], tokens[3]. The problem is that, I want the sentences only without the double quotations. But my program saved the sentences with “”. How can I improve the parsing technique so I can save the sentences without “” ??

  • 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-06T01:29:27+00:00Added an answer on June 6, 2026 at 1:29 am

    How about String#replaceAll:

    theSentence = theSentence.replaceAll("\"", "");
    

    In newer Java versions, I think from Java 5, you can use String#replace(CharSequence,CharSequence) as well:

    theSentence = theSentence.replace("\"", "");
    

    And avoid the overhead of regex

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

Sidebar

Related Questions

I'm learning java and I have made simple program that simply reads value from
I have a simple application that reads data in small strings from large text
I have the following simple Java code: package testj; import java.util.*; public class Query<T>
I have a simple java program which is just a single piece of code
I have a simple code below: import java.util.ArrayList; public class BoidList extends ArrayList {
I have a simple JComboBox filter code like this : import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent;
I have a simple Java app that inserts records into a table A, linking
I have a simple Java question here. I want to auto text scroll to
I have simple code that wants to read the state of network connection. I've
I have an application written in Java that uses a jar file(it uses more

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.