1

Here is the code and what I want to do

Reader reader = new BufferedReader (new InputStreamReader (new URL (url).openStream()));

/*
 * I want to do this code before sending to CsvDataSourceHelper
 * but Reader has no method replace ^^
 *
 * reader.replace("+", "").replace("%", "");
 */

DataTable dataTable = CsvDataSourceHelper.read(reader, column, false);

url is a string with a url of a csv file
column is an ArrayList of ColumnDescription
DataTable and CsvDataSourceHelper are classes created by Google
reader is a csv file

DataTable Documentation
CsvDataSourceHelper Documentation

reader receives a csv file from the internet
I must send this csv file to CsvDataSourceHelper
The problem is that the csv file is incorrectly formatted, I would remove the + and % before sending to CsvDataSourceHelper
I could do it after, with a for loop on dataTable, but the problem is that the file is incorrectly formatted so CsvDataSourceHelper does not give me the right result

Thank you

demongolem
  • 9,474
  • 36
  • 90
  • 105

1 Answers1

0

You should likely implement a FilterReader that does this conversion.

There is example code at java2s.com that strips html tags. If you only need to strip two characters, it should be much simpler.

Don Roby
  • 40,677
  • 6
  • 91
  • 113
  • Thank you, i dit not know FilterReader. But i used this [link](http://stackoverflow.com/questions/3607010/remove-or-ignore-character-from-reader) instead your link – UnicornMaster May 23 '14 at 03:07