Question Process large string..best method?

ballybeg

Member
Joined
Jul 28, 2011
Messages
20
Location
Canberra Australia
Programming Experience
10+
Hi all, in an app I am developing i retrieve several large strings through a 3rd party dll. The output is defined as a fixed string buffer large enough to hold the data, and it is :

VB.NET:
[FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] Dim[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] buf [/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] VB6.[/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]FixedLengthString[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000](16384)[/COLOR]
 [/SIZE][/FONT][/SIZE][/FONT]

a sample of the output is this:

OK Meetings 09:14:04
CANNINGTON,G,12,20110924,WG,WG,WG,WG,PG,PG,21:05:00VNU,21:27:00V,21:50:00VN,22:10:00VNU,22:35:00V,22:52:00VN,23:12:00VNU,,
RICHMOND,G,10,20110924,TG,TG,TG,TG,NG,NG,18:59:00N,19:16:00,19:39:00,19:56:00N,20:16:00N,20:41:00N,20:59:00N,21:19:00,21:41:00,22:04:00N,,
THE GARDENS,G,10,20110924,CG,CG,CG,CG,CG,CG,17:29:00V,17:51:00N,18:07:00N,18:31:00,18:54:00N,19:11:00N,19:34:00,19:51:00N,20:11:00N,20:34:00N,,

and there are usually about 30 lines of output.

buf is a string and my question is what is the BEST way to process it. Each line is comma delimited and positionally each item corresponds to a position defined in a spec. Currently, using for/next processes I read the string into a 2 dim array and reference the data though reference to that matrix. Not all the data is relevant but what I need I want to read into a data store. I feel I am double handling, by first reading into an array, then processing to storage.

I am redeveloping the app and was wondering if there was a better way to get the data from the string into the store?

regards

ballybeg
 

Latest posts

Back
Top