Hi,

 

  You could always us the VB function:  split

 

 

Dim varSplit as variant

Dim thecount as integer

 

Split(thestring,thedelimiter)

 

This will split your string at the delimiter specified, and you can then
reference either side of the string (or multiple parts if the delimiter
exists more than once in the string) by referencing its position.

 

So if you had the line:

 

Tmpstring = "This is a test | another test | the third test | etc"

 

And you did 

 

                varsplit = split(tmpstring,"|")

 

this will split the string into four parts.

 

                varSplit(0) would be "This is a test"

                varsplit(1) would be "another test"

                varSplit(2) would be "the third test"

                varSplit(3) would be "etc"

 

you can also find how many items you have by doing a 

                thecount = Ubound(varSplit)

 

You can use Ubound for the Upper boundary (last record) and Lbound for
the lower boundary (first record)

 

Remember that variables in VB are Zero Indexed, so your first item will
always be item 0 not 1.

 

Tim

 

 

 

 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Shirley Hammack
Sent: Friday, August 24, 2007 10:49 AM
To: [email protected]
Subject: RE: [Talk] String Extraction / Mulitple Delimiters 

 

I would start like this:

 

Dim strFullString As String
Dim intPosition As Integer
Dim strRelevantStuff As String

 

intPosition = InStr(strFullString, "=")
strRelevantStuff = Right(strFullString, Len(strFullString) -
intPosition)
Enter strRelevantStuff

I find that if I try to condense the math too much I get error messages.

Shirley Hammack
I.T. Financial Analyst
Jackson County Memorial Hospital
580-477-7484

        -----Original Message-----
        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Stephen R. Smesny
        Sent: Friday, August 24, 2007 11:59 AM
        To: [email protected]
        Subject: [Talk] String Extraction / Mulitple Delimiters 

        I have a pipe delimited file that produces records as follows
when opened in datastation:

         

        1       MT6=1

        2       EY5=1

        3       EY8=08/23/2007

        4       G8=0

         

        .........and so on

         

        When keying these records into the application I only need the
application to key the data to the right of the '=' sign.  What string
extraction command can I use to accomplish this?  

         

        Or another solution to my problem would be to parse the file
using 2 delimiters.  I would need to open the file with '|' and '=' as a
delimiter.  Then the actual fields I would need to key would be in every
other field which would not be a problem.  I am just not sure if it is
possible to open a file in datastation like this.

         

        Thanks in advance for any help or suggestions.

         

         

         

        Stephen Smesny

        Programmer \ Analyst

        Beaufort Memorial Hospital

        [EMAIL PROTECTED]

        843-522-7915

         

         

         

         

        
**********************************************************************

        The information contained in this electronic communication, and
any electronic attachment(s), is CONFIDENTIAL and is intended only for
the named recipient(s) above. If the reader of this message is not the
intended recipient(s), you are hereby notified that any release of
information or distribution of this communication is prohibited by law.
If you have received this message in error, or are not the named
recipient(s), please immediately notify the sender via reply email and
delete this communication.

        
**********************************************************************

         

        This message was scanned with MIMESweeper.

        
------------------------------------------------------------------------
---------------------
        This email has been scanned by the JCMH IronPort appliance and
has been cleared for delivery.
        If you have any concerns or questions, call the IT Helpdesk at
x2646. 
        
------------------------------------------------------------------------
---------------------

------------------------------------------------------------------------
------------------------------------------------------------
The documents accompanying this transmission contain confidential
information, belonging to the sender, that is legally privileged.
This information is intended only for the use of the individual or
entity named above. The authorized recipient of this information
is prohibited from disclosing this information after its stated need has
been fulfilled.
 
If you are not the intended recipient, you are hereby notified that any
reading, disclosure, copying, distribution, or action taken
in reliance on the contents of these documents is strictly prohibited.
Violators may be prosecuted. If you have received this email
in error, please notify the sender immediately and destroy the
transmitted information. 
------------------------------------------------------------------------
------------------------------------------------------------


CONFIDENTIALITY NOTICE: This message and any included attachments are from 
Salinas Valley Memorial Hospital and are intended only for the addressee. The 
information contained in this message is confidential and may constitute inside 
or non-public information under international, federal, or state securities 
laws. Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Salinas Valley Memorial Healthcare 
System's Privacy Officer in Salinas, California, U.S.A at (+1) (831) 755-0751.

Reply via email to