Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to parse fixed length text file
Message
De
29/04/2009 10:00:12
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01396650
Message ID:
01396946
Vues:
78
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform