Re: ArrayList....how create it?help me....
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Fri, 09 Jun 2006 17:29:23 GMT
"gbattine" <gbattine@xxxxxxxx> wrote in message news:1149864900.759597.315930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I try to be more clear because the problem is slightly changed
This is a piece of my file
ProbesetID MAO.CEL MAO1.CEL MAO2.CEL MAM.CEL....
1007_s_at 2527,515572
2745,427613 2721,744091
1053_at 39,40240421
39,61677933 40,49511453
...... .
The .... mean the number of rows and number of columns are variable,but
i know them from my java application
Does every row within a given file have the same number of columns? I'm going to assume so for the rest of this post.
About my txt files my first row must be ever present and change from
file to file,but it has only string value, it's a heading.
The other rows have the same format that is string double double double
etc....
I have to store this file as it is.
I 've thinked i can store the heading into an object, a generic row(not
the first) into another one.
Later my file will have an objetc(heading) and an Arraylist(for the
other rows).
If you have to store the file "as is" (presumably in a DB), then just store the file. Don't do any parsing, don't create arraylists, or anything like that. Otherwise, you'll lose whitespace information, among other things.
Can you help me with this code?
How can i set initial size of arraylist?(Suppose my file can have a
number of rows from 10000 to 50000).
Like I said, don't do any parsing of any kind. Just dump the entire string a a field in the DB.
If you really want to stick with ArrayList, don't set an initial size at all. Or set the initial size to 10000. Or 50000. It really doesn't matter. What you set it to, because the ArrayList will grow as needed.
Once this is done i have to store this complex object(the object and
the arraylist) into an array of bytes,using convention to insert a "
"(white space) that separe the columns and a special character(ex.§)
to separe different rows.
Now it sounds like you must NOT store the file "as is", but rather do some sort of complicated conversion. Which is it? If you need to store it as bytes, instead of as characters, you'll need to choose na encoding system.
Using these convention and knowing the number of columns i can create
an inverse procedure that read the array of bytes and show exactly in
my web application the original file as i 'ive uploaded it.
If you need to show the data exactly as it was formatted, you should not do the above mentioned "compiclated conversion". Get your requirements clarified from your boss, client, teacher, or whoever it is asking you to do this stuff.
- Oliver
.
- References:
- Problems with map implementation...help me!!!Please...
- From: gbattine
- Re: Problems with map implementation...help me!!!Please...
- From: Oliver Wong
- ArrayList....how create it?help me....
- From: gbattine
- Problems with map implementation...help me!!!Please...
- Prev by Date: Re: "abstract interface" in java
- Next by Date: Re: Any good GUI editors out there?
- Previous by thread: ArrayList....how create it?help me....
- Next by thread: automatic number plate recognition
- Index(es):
Relevant Pages
|
Loading