G
gbattine
Hi guys,
i first thank you for all the help you've given in my precedent posts.
Now i've to ask you a question.
I need to convert some lines of a txt file(obtained from an excel
table) into an array of byte in the best possible manner.
My file can have a various number of rows and columns.
With this code
BufferedReader br = new BufferedReader(new
InputStreamReader(myFile.getInputStream()));
String line = null;
while ((line = br.readLine()) != null) {
line = line.replace (',', '.');
StringTokenizer st = new StringTokenizer(line);
numberOfNumericColumns = (st.countTokens()-1);
col=(numberOfNumericColumns+1);
I read the file, i change , with . and line to line i calculate the
number of value(that have to be the same,i do the control for showing
exception if necessary).
Now i know from my file what are the number of values in a row(columns
of my old excel table).
I have to convert this file into an array of byte.
How can i do it?
Suppose we have only 3 lines, the first line is ever only string,the
others lines have a string and other double values.....
nome giuseppe carmine paolo
valerio 23.3 34.3 43.3
paolo 21.2 34.5 12.2
each value is separated from another one by one or more whitespaces..
The most important thing is that in a second moment i have to read this
array of byte and showing its original content,so i have to put in the
array some different value and different line symbol delimiter.
Can you help me giving me some idea or code?(please be clear,i'm
inexpert of java...)
Thanks very much,i need your help
i first thank you for all the help you've given in my precedent posts.
Now i've to ask you a question.
I need to convert some lines of a txt file(obtained from an excel
table) into an array of byte in the best possible manner.
My file can have a various number of rows and columns.
With this code
BufferedReader br = new BufferedReader(new
InputStreamReader(myFile.getInputStream()));
String line = null;
while ((line = br.readLine()) != null) {
line = line.replace (',', '.');
StringTokenizer st = new StringTokenizer(line);
numberOfNumericColumns = (st.countTokens()-1);
col=(numberOfNumericColumns+1);
I read the file, i change , with . and line to line i calculate the
number of value(that have to be the same,i do the control for showing
exception if necessary).
Now i know from my file what are the number of values in a row(columns
of my old excel table).
I have to convert this file into an array of byte.
How can i do it?
Suppose we have only 3 lines, the first line is ever only string,the
others lines have a string and other double values.....
nome giuseppe carmine paolo
valerio 23.3 34.3 43.3
paolo 21.2 34.5 12.2
each value is separated from another one by one or more whitespaces..
The most important thing is that in a second moment i have to read this
array of byte and showing its original content,so i have to put in the
array some different value and different line symbol delimiter.
Can you help me giving me some idea or code?(please be clear,i'm
inexpert of java...)
Thanks very much,i need your help