Parsing CSV strings like "Doe, John",33, "6'2""" 
Author Message
 Parsing CSV strings like "Doe, John",33, "6'2"""

This is a multi-part message in MIME format.

------=_NextPart_000_01BC9377.CEDFDC60
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello fellow VBers!

I needed to parse strings containing a comma delimited variables (quotes
around strings).

For example, to convert a string like:
        "Doe, John",33, "6'2"""
into an array, such that:
        Arr(0)= Doe, John
        Arr(1)= 33
        Arr(2)= 6'2"

Ok, so I wrote a procedure that does this, and it works.  But, the
procedure is huge, slow and very ugly.

It's so ugly that I feel that I'm overlooking a simpler way to do this.

I am wondering if any other coders would care to suggest such a technique?


------=_NextPart_000_01BC9377.CEDFDC60
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#000000" face=3D"Arial">Hello fellow VBers!<br><br>I needed to =
parse strings containing a comma delimited variables (quotes around =
strings).<br><br>For example, to convert a string =
like:<br>&#009;&quot;Doe, John&quot;,33, =
&quot;6'2&quot;&quot;&quot;<br>into an array, such =
that:<br>&#009;Arr(0)=3D Doe, John<br>&#009;Arr(1)=3D =
33<br>&#009;Arr(2)=3D 6'2&quot;<br>&#009;<br><br>Ok, so I wrote a =
procedure that does this, and it works. &nbsp;But, the procedure is =
huge, slow and very ugly.<br><br>It's so ugly that I feel that I'm =
overlooking a simpler way to do this.<br><br>I am wondering if any other =
coders would care to suggest such a =

</font></body></html>
------=_NextPart_000_01BC9377.CEDFDC60--



Tue, 04 Jan 2000 03:00:00 GMT  
 Parsing CSV strings like "Doe, John",33, "6'2"""

String manipulation, and parsing in particular, is not one of VBs strongest
attributes, actually it just as you described it -- slow and ugly.  the
best solution would be to write a simple C/C++ DLL to pass the delimited
string and return an array.  VBPJ published an article on this technique a
couple of months ago.



Hello fellow VBers!

I needed to parse strings containing a comma delimited variables (quotes
around strings).

For example, to convert a string like:
        "Doe, John",33, "6'2"""
into an array, such that:
        Arr(0)= Doe, John
        Arr(1)= 33
        Arr(2)= 6'2"

Ok, so I wrote a procedure that does this, and it works.  But, the
procedure is huge, slow and very ugly.
It's so ugly that I feel that I'm overlooking a simpler way to do this.
I am wondering if any other coders would care to suggest such a technique?



Fri, 07 Jan 2000 03:00:00 GMT  
 Parsing CSV strings like "Doe, John",33, "6'2"""

I do this all the time using Videosoft's VSAwk control - comes with
their VSOCX control.  Could do it without a control, but this does
the job in just a couple lines and I am usually in a hurry.

Todd

Quote:

>I needed to parse strings containing a comma delimited variables (quotes
>around strings).

>For example, to convert a string like:
> "Doe, John",33, "6'2"""
>into an array, such that:
> Arr(0)= Doe, John
> Arr(1)= 33
> Arr(2)= 6'2"

>Ok, so I wrote a procedure that does this, and it works.  But, the
>procedure is huge, slow and very ugly.
>It's so ugly that I feel that I'm overlooking a simpler way to do this.
>I am wondering if any other coders would care to suggest such a technique?



Fri, 14 Jan 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Parsing CSV strings like "Doe, John",33, "6'2"""

2. Origin of "John Doe"

3. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

4. GetObject("","InternetExplorer.Application") fails in Excel VBA

5. SysCmd 603, "path","path"

6. Disabling "BACK"/"FORWARD" buttons

7. Loop print "VARIABLE", "VARIABLE"

8. DLL or something like "#"#ยค#"!"#

9. Disabling "BACK"/"FORWARD" buttons

10. CreateObject("Excel","//server"), MsgBox output

11. Problem With "window.showmodaldialog("")"

12. CreateObject("Excel","//server"), MsgBox output

 

 
Powered by phpBB® Forum Software