Re: ArrayList....how create it?help me....



"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

.



Relevant Pages

  • Re: Storing a value for later use in vba or a Macro
    ... Dim strCurrentCustomer as String ... do you programmatically store a value from one record to use in ...
    (microsoft.public.access.gettingstarted)
  • Re: Storing a datatable (or arraylist )on ASP.NET Session
    ... Perhaps your ArrayList store smth which can't be casted to object. ... If exactly that code u shown didn't work (emply arraylists) that I recomment to re-register asp.net 2.0 calling aspnet_regiis,exe - i ... Team blog: http://devkids.blogspot.com/ ... b> session variables is stored on web server's local sql database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Storing wave files in database
    ... analyse them and store everything in some sort of database. ... You don't store the Wave files in the database. ... ByVal lpOperation As String, _ ... Dim lRet As Long, varTaskID As Variant ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Question about a data structure
    ... I'll store the ... string, it could just be a simgle 150 character string. ... , personally, I'd avoid 'stringing' together responses. ...
    (alt.php)
  • RE: adding data to a file before it gets regexed
    ... The reasion I am trying to add the string to the line, is so that I can use ... it is not a good idea to store entire files in memory and it is really ... the arrays are the contents of the files broken down by lines. ... Any opinion expressed in this e-mail is personal to the sender ...
    (perl.beginners)

Loading