Android Question Parsing String ... breaking the sf. habit [Solved.]

Todd Carlton

Member
Licensed User
I have an application I wrote in B4A years ago (B4A v3??) with sf.mid that I am revisiting, without the sf library.

My issue is that I am manipulating a data file generated in a Windows application that has several other support programs that use it. I cannot just 'choose' a different format. For compatibility I have to use what I am supplied; input and output.

A data file may have as few as one or as many as 'thousands' of lines of ascii to be read individually.

The first 30 characters are non-delimited fixed length fields, followed by a pipe, followed by a variable length field, followed by a pipe and CRLF.

Example:
0105262013048645A000000.00||

Key:
11222222223333334555555555|6|

1: two digits (0-9)
2: eight digits (0-9)
3: six digits (0-9)
4: single character, capital alpha only (A-Z)
5: six digits, a period, and two digits (0-9, . 0-9)
6: Any number of alpha numeric characters (including none) and including high ascii

I need to read each line into the six variables. With .net and MID is was pretty simple.

All six variables are strings although their rules must be kept for validity checks.

Suggestions for where to start with B4A v9.8??


UPDATE: Never mind. I found Substring2 and IndexOf2. Instead of deleting, I am going to leave this post here for future reference.
 
Last edited:
Top