Stripping and Parsing Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following information that automatically pastes into a field from
a web application.


------------01 01 00------------
3F AD 30 1F A0 CD 9E CE
54 69 8E 15 B3 65 09 FC
C1 81 7A D3 6F DF 3F A7
D5 8D 9E 3D 3D EA 22 1E


------------01 01 00------------
0F 4D 5A 74 8F 4C 62 F6
C9 FC A4 61 84 5D 50 68
B6 DA 16 2B 65 8A 42 B7
01 79 36 03 F4 C5 DF 83

I want to strip (Take Out) out

------------01 01 00------------

and ------------01 01 00------------ in the second set of codes

I want to have in a query 8 fields, field 1, field2, ect, field 8

3F AD 30 1F A0 CD 9E CE (in field 1)
54 69 8E 15 B3 65 09 FC (in Field 2
C1 81 7A D3 6F DF 3F A7 (Field 3)
D5 8D 9E 3D 3D EA 22 1E (Field 4)
0F 4D 5A 74 8F 4C 62 F6 (field 5)
C1 81 7A D3 6F DF 3F A7 (Field 6)

I think I have to parse and another function...ANy help would be appreciated
 
Is everything in just one field in your table? Does it display just as you
posted it so we can assume there is a vbCr and probably a vbLf at the end of
each line?
 
Yep, your right it comes in as one field...I did however strip and parse it
to 2 fields

6F 32 9A CA CE 2E 53 D6
36 B5 D5 7F B8 33 3A 58
C1 81 7A D3 6F DF 3F A7
D5 8D 9E 3D 3D EA 22 1E

and

6F 32 9A CA CE 2E 53 D6
36 B5 D5 7F B8 33 3A 58
C1 81 7A D3 6F DF 3F A7
D5 8D 9E 3D 3D EA 22 1E

Now If I can just put each line in its own field I will have it beat.

Keep in mind these numbers can change hourly.
thanks for the reply
 
Maybe this function in a standard module named basFunctions will help:

Function ParseLine(InString As String, LineNo As Integer) As String
'-- Return the LineNo string from the following sample input:
'-- 6F 32 9A CA CE 2E 53 D6
'-- 36 B5 D5 7F B8 33 3A 58
'-- C1 81 7A D3 6F DF 3F A7
'-- D5 8D 9E 3D 3D EA 22 1E
'-- Called with ParseLine([YourField],2) if you want the second string of
characters.

Dim MyArray As Variant

MyArray = Split(InString, vbCrLf)

ParseLine = MyArray(LineNo - 1)

End Function


Yep, your right it comes in as one field...I did however strip and parse it
to 2 fields

6F 32 9A CA CE 2E 53 D6
36 B5 D5 7F B8 33 3A 58
C1 81 7A D3 6F DF 3F A7
D5 8D 9E 3D 3D EA 22 1E

and

6F 32 9A CA CE 2E 53 D6
36 B5 D5 7F B8 33 3A 58
C1 81 7A D3 6F DF 3F A7
D5 8D 9E 3D 3D EA 22 1E

Now If I can just put each line in its own field I will have it beat.

Keep in mind these numbers can change hourly.
thanks for the reply
Is everything in just one field in your table? Does it display just as you
posted it so we can assume there is a vbCr and probably a vbLf at the end of
[quoted text clipped - 31 lines]
 
Back
Top