Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping through a TXT to grab case num

Status
Not open for further replies.

txgeekgirl1

Programmer
Sep 10, 2009
85
US
I have a single column txt with seperator and a carriage return. Here - msgbox(s) is return the name of the file, not the first line inside the txt. Can anyone tell what I messed up?

Code:
 Dim myRootpath As String = "\\backupcenter\PDF_Archives$\MedRecords\"
    Dim myTemplatePath As String = "\\rbas\e$\EMR\Templates\"
    Dim mySource As String = "MHADLive" 'change as needed for conversions MHADLive, MHCHLive, MRA
    Dim PatList As String = "\\rbas\outbox\2818\mhchCur.txt" 'change as needed mhadCur. mhchCur, mraCur"
    Dim PatientCB As String

    Sub Main()

        Dim str As String() = PatList.Split(New [Char]() {CChar(vbCrLf)})
        For Each s As String In str
            MsgBox(s)
        Next
 
I got an answer - here it is.

Dim Lines = IO.File.ReadAllLines(PatList)

For Row As Integer = 0 To Lines.Count - 1
PatientCB = Lines(Row)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top