Jump to content
Sign in to follow this  

_StringBetween Question

Recommended Posts


Hey everyone,

          Question about StringBetween.    Does StringBetween only work on a single line of text?    I have a text file that looks like this:

DATE:  9/05/16                                LOCATION                                                                                                              PAGE   1
    TIME:  5:46                                    SERVICES REPORT                                                                                                DATA2
                                                                DATA 09/04/16

DATA-----------------------------               INFORMATION----------------
   NUM/NAME-: 1234567  SMITH JOHN                   DATE------:   9/03/16  11:23 
   DATA: 123456                                  DATA----:   9/99/99  19:15 
   DATA #   : 123456                                                                DATA  BILL-:    
   DATA------: M F                                      DATA TYPE-----:  1234            
   DATA----: 99/99/0999                                        DATA-------:  O1  DATA 
   DATA---: 1234567 DATA                     
   DATA--: M
   DATA.-: 0999999999
   ADDRESS-1: 1234 DATA RD                      DATA  INFORMATION------------
   ADDRESS-2:                                         DATE/TIME-----:                 
   CITY-----: DATA                           PLACE---------:                 
   ST/ZIP---: DATA  / 99999                             EVENT---------:                 
DATA--------------------------------                              DATA   INFORMATION--------
   DATA-----: SMITH JOHN                                      DATA------:  DATA             
   ADDRESS-1: 1234 DATA RD                            DATA----:                 
   ADDRESS-2:                                         ADDRESS-------:  DATA ROAD               
   CITY-----: DATA                                     PHONE---------:                
   ST/ZIP---: DATA  / 99999               
   PHONE----:   999-999-9999
   BIRTH----: 99/99/9999
   DATA------: M
   DATA.-: 9999999999
DATA------------------                         1234 DATA DATA                

And this repeats for 100 times more or less  in the file.

But when I run this:

#include <file.au3>
#include <Array.au3>
#include <String.au3>
#include <StringConstants.au3>
#include <Date.au3>
#include <Excel.au3>
#include <ExcelConstants.au3>

$sStart = 'NUM'
$sData=_StringBetween($sData, $sStart, $sEnd, $STR_ENDNOTSTART, True)

It only pulls the line the begins with NUM.   Shouldn't it pull all data between NUM and DIAGNOSIS?  Am I doing something wrong?

Thank you for any help.

Share this post

Link to post
Share on other sites

Ok never mind,    I found out what was wrong.   The _ArrayDisplay was only showing the one line. But when I wrote the data to a file it was all there.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.