Stripping/Parsing data 
Author Message
 Stripping/Parsing data

I have a query that contains an address field that can be
multiple lines of data in the address field.  However, the
data is display as follows:  345 NE Smith Street;PO Box
123.

I am looking for code to strip out the ";" and replace it
with a line feed/Character Return.

thanks,

Karen Schaefer



Wed, 09 Nov 2005 06:00:43 GMT  
 Stripping/Parsing data
Try using len(strAddress) to get the length of the entire
string.  Once you have that, loop through the string
looking at one character at a time with mid
(strAddress,x,1) (where x is the loop increment).  After
the Mid(),(but within the loop) check for the ";" with
strcomp(;).

Knowing the position that you found the ";", use the mid
function to strip out the fromnt and back parts, and join
them like this,

strNew = strFirstPart & vbcrlf & strSecondPart.

Use help to look up how to apply the above functions.

Greg

Quote:
>-----Original Message-----
>I have a query that contains an address field that can
be
>multiple lines of data in the address field.  However,
the
>data is display as follows:  345 NE Smith Street;PO Box
>123.

>I am looking for code to strip out the ";" and replace
it
>with a line feed/Character Return.

>thanks,

>Karen Schaefer
>.



Wed, 09 Nov 2005 18:37:12 GMT  
 Stripping/Parsing data


Quote:
>Try using len(strAddress) to get the length of the entire
>string.  Once you have that, loop through the string
>looking at one character at a time with mid
>(strAddress,x,1) (where x is the loop increment).  After
>the Mid(),(but within the loop) check for the ";" with
>strcomp(;).

>Knowing the position that you found the ";", use the mid
>function to strip out the fromnt and back parts, and join
>them like this,

>strNew = strFirstPart & vbcrlf & strSecondPart.

>Use help to look up how to apply the above functions.

That would work, but it's simpler to use InStr(string, ";") to find
the position of the semicolon. No need to loop!

                  John W. Vinson[MVP]    
    Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



Thu, 10 Nov 2005 03:04:20 GMT  
 Stripping/Parsing data
I'm kind of new at this, but I think the answer to your
question is in Microsoft Knowledge Base Article - 210372  
ACC2000: Imported Excel Carriage Returns Become Square
Boxes, where they give a routine to identify CrLf's
generated by Chr(13) in other apps, and replace them with
Chr(13) & Chr(10), which is what Access will recognize as a
CrLf.
Hope this helps.

-John McE

Quote:
>-----Original Message-----
>I have a query that contains an address field that can be
>multiple lines of data in the address field.  However, the
>data is display as follows:  345 NE Smith Street;PO Box
>123.

>I am looking for code to strip out the ";" and replace it
>with a line feed/Character Return.

>thanks,

>Karen Schaefer
>.



Thu, 10 Nov 2005 08:58:11 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Stripping data out of text w/VB 4.0

2. Stripping of unwanted data from text file

3. parse data into flat file structure

4. Parse data within text strings

5. How to parse data from a HTML file to VBA

6. Parsing data from an email

7. Complicated Problems Parsing Data

8. Importing/Parsing MS Word Data

9. Parsing doc for specific data

10. Storing Data while parsing to load as a unit

11. Parsing data from ACT database

12. Help needed parsing data

 

 
Powered by phpBB® Forum Software