help parsing Text data line input with arrays? vb6.0 
Author Message
 help parsing Text data line input with arrays? vb6.0

 need to take this text file information and send each group for each part
into a sub routine.
any help with ideas on how to do it would be very helpfull.
this is a  generated log and can be formated diffrently
I have placed the part number to seperate the data..
with a print#, statement into the save as log sub.
the log view needs to set each parts information into its own array.
there can be as few  as 2 parts or as many as 24 at any given time.

Part14
st Name="Refit Truck"
uc MasterID=35
uc MasterID=6
uc MasterID=1
Part15
st MechType="Mad Cat J"
st Name="Mad Cat J"
uc MasterID=35
uc MasterID=34
uc MasterID=34
uc MasterID=33
uc MasterID=33
uc MasterID=20

The Log File is still being read into the buffer [while not eof line input
#filenum ,logdata] yayadadada....
if you notice from the above i need to pull the  uc MasterID numbers and
count them as well they identify
a detail part of the data that is being saved. so part15  has 2 "uc
MasterID=33" and part14  has none.
but part16 may have 4 "uc MasterID=33"
Each part#  is a new group but I havent been able to seperate them into
single arrays

If data2 = "Part1" Then data after this line input to the data to the next
part# go's sub subrutine.
If data2 = "Part2" Then Label5.Caption = data2

subroutine....
If wepdata2 = "uc MasterID=143" Then weapons1 = "IS - Medium Laser": count1
= (count1 + 1)
If wepdata2 = "uc MasterID=140" Then weapons2 = "IS - Large Laser": count2 =
(count2 + 1)
return

wend
close filenum

Any Ideas???



Thu, 14 Oct 2004 06:44:05 GMT  
 help parsing Text data line input with arrays? vb6.0

Quote:

> need to take this text file information and send each group for each part
> into a sub routine.
> any help with ideas on how to do it would be very helpfull.
> this is a  generated log and can be formated diffrently
> I have placed the part number to seperate the data..
> with a print#, statement into the save as log sub.
> the log view needs to set each parts information into its own array.
> there can be as few  as 2 parts or as many as 24 at any given time.

> Part14
> st Name="Refit Truck"
> uc MasterID=35
> uc MasterID=6
> uc MasterID=1
> Part15
> st MechType="Mad Cat J"
> st Name="Mad Cat J"
> uc MasterID=35
> uc MasterID=34
> uc MasterID=34
> uc MasterID=33
> uc MasterID=33
> uc MasterID=20

> The Log File is still being read into the buffer [while not eof line input
> #filenum ,logdata] yayadadada....
> if you notice from the above i need to pull the  uc MasterID numbers and
> count them as well they identify
> a detail part of the data that is being saved. so part15  has 2 "uc
> MasterID=33" and part14  has none.
> but part16 may have 4 "uc MasterID=33"
> Each part#  is a new group but I havent been able to seperate them into
> single arrays

> If data2 = "Part1" Then data after this line input to the data to the next
> part# go's sub subrutine.
> If data2 = "Part2" Then Label5.Caption = data2

> subroutine....
> If wepdata2 = "uc MasterID=143" Then weapons1 = "IS - Medium Laser": count1
> = (count1 + 1)
> If wepdata2 = "uc MasterID=140" Then weapons2 = "IS - Large Laser": count2 =
> (count2 + 1)
> return

> wend
> close filenum

> Any Ideas???

if I understand this correctly it seems you need a two dimension
array.

first dimension is part number
second dimension is uc number.

if your part numbers are sequential you can use the part number as the
array index. similarly you may be able to use the master id number as
the array index.

otherwise you need to create one array for each part number. I tend to
create them as large as required initially so I don't run into
problems with insufficient memory in the middle of the program.



Mon, 18 Oct 2004 01:06:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Comapring Text box inputs with array data.

2. parsing a formated text input file

3. Parsing Text Files for Input to FlexGrid

4. Line input into array ?

5. file-line input to array

6. Line Input vesus array

7. Parsing a three line text file

8. Help - Multiple lines for ToolTip Text? - VB6.0

9. Help parse a text string from sequential text file

10. Line Input (from a Unix Text file)

11. text file line input

12. ??? Using Split instead of Line Input to read huge text files

 

 
Powered by phpBB® Forum Software