Message 1 of 4
memory use - string or array of strings
Not applicable
08-19-2002
12:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to read a text file into memory and then examine elements in the
string/s looking for various structures or characters and divide the string
according to such characters. The characters and structures will possibly
span multiple lines of the text file with no set format I can rely on so I
need to in effect ignore the original line breaks in the text file and look
only at it's string/text values.
Are there any memory issues I should consider if I want to read a text file
into a string variable?
The question is should I read it into one giant string and then process
that - or -
should I read it into an array of strings (one string for each line in
file). Is there a limit to the size of a string variable in vb? vba?
My processing will have to look through the resultant structure (spanning
lines of the original file) or basically ignoring the division into lines
that the file has.
That would possibly be an advantage in putting the whole file into one
string- then my parsing routine doesn't need a bunch of code to jump to next
line (item in array) and can just move through the string start to end.
any thoughts on this?
Thanks,
mark
I want to read a text file into memory and then examine elements in the
string/s looking for various structures or characters and divide the string
according to such characters. The characters and structures will possibly
span multiple lines of the text file with no set format I can rely on so I
need to in effect ignore the original line breaks in the text file and look
only at it's string/text values.
Are there any memory issues I should consider if I want to read a text file
into a string variable?
The question is should I read it into one giant string and then process
that - or -
should I read it into an array of strings (one string for each line in
file). Is there a limit to the size of a string variable in vb? vba?
My processing will have to look through the resultant structure (spanning
lines of the original file) or basically ignoring the division into lines
that the file has.
That would possibly be an advantage in putting the whole file into one
string- then my parsing routine doesn't need a bunch of code to jump to next
line (item in array) and can just move through the string start to end.
any thoughts on this?
Thanks,
mark