Okay I am not sure what I am doing wrong and it might be my inadequate interpretation of regular expressions but the following is not working... not even for the first line. What I am looking for is a split after all spaces.
---------Snippet----------------- sr = System.IO.File.OpenText(filePath) Dim strLine As String = sr.ReadLine() Do While strLine <> "" Dim myArray As Array myArray = Regex.Split(strLine, "^\s?") --------End Snippet--------------- Ronda On Mon, 28 Feb 2005 10:24:11 -0600, Ronda K <[EMAIL PROTECTED]> wrote: > Ian, > > Don't know why I didn't think about regular expressions... I will try it now. > > I was just using string.split() > > Thanks, > Ronda > > > On Mon, 28 Feb 2005 16:06:28 -0000, Ian Payne > <[EMAIL PROTECTED]> wrote: > > > > Use Regex.Split? > > > > -----Original Message----- > > From: Ronda K [mailto:[EMAIL PROTECTED] > > Sent: 28 February 2005 15:53 > > To: [email protected] > > Subject: [AspNetAnyQuestionIsOk] Parsing Text Files > > > > I am dealing with a text file that contains shipping information it is > > coming out of a very archaic system. The file looks something like > > this: > > > > RPS AIR-PP SL29799EA DEBBIE RUSKOWSKY 23322 > > 3.00 .00 055108800099191 996060 86658 > > RPS AIR-PP SL33098 MICHAEL DEMERS 80631 > > 2.00 .00 055108800099153 997340 86658 > > RPS AIR-PP SL33103 PASITHORN SUWANABOL 53705 > > 4.00 .00 055108800099221 998460 86658 > > RPS AIR-PP SL33104 LISA PAYTON 33133 > > 3.00 .00 055108800099207 998470 86658 > > RPS AIR-PP SL33108 PHILIP ALVAREZ-CORREA 03741 > > 3.00 .00 055108800099214 998630 86658 > > > > If you open it in Excel each line reads in one cell indicating that > > there is not a tab character in there. This is confirmed when I try > > to create an array and break it on chr(32). I have also tried to > > create an array and break it on chr(9) but that is not working either > > - I get way too many fields. How do I specify to break on the next > > non-space character? I need to get out the shipping method, order # > > and tracking # when it is all said and done. > > > > TIA, > > > > -- > > Ronda Pederson > > MVP ASP.Net > > > > Yahoo! Groups Links > > > > > > Yahoo! Groups Links > > > > > > > > > > > > -- > Ronda Pederson > MVP ASP.Net > -- Ronda Pederson MVP ASP.Net -- Ronda Pederson MVP ASP.Net Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
