Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to parse fixed length text file
Message
From
29/04/2009 10:00:12
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01396650
Message ID:
01396946
Views:
80
>Greg - while I have your ear - what do I need to change in order for Matches to match only lines that begin with BX followed by the other stuff we have ?

Pete,

So I understand correctly

Do you want
(1) to pass the whole file to a regex

(2) Pass line by line to the regex

In (2)
change
string pattern = "^(.{12})(.{17})(.{18})(.{21})(.{31})(.{10})$";

into 
string pattern = "^(BX.{10})(.{17})(.{18})(.{21})(.{31})(.{10})$";

( and be prepared for lines that do not match)
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform