NiTrOuS Posted April 6, 2006 Share Posted April 6, 2006 "Paint1.job" (mspt.exe) 6/04/2006 11:13:00 ** ERROR ** Voilà, comment dois-je faire en VB.NET pour parvenir à extraire la date de cette ligne, sachant que le début comme la fin peut changer. Exemple: "Paint1.job" (mspt.exe) 6/04/2006 11:13:00 ** ERROR ** "Task Scheduler Service" 8/03/2006 10:53:33 ** Error ** "New Task 2.job" (mspnt.exe) 27/03/2006 12:09:00 ** ERROR ** Etc Merci Link to comment Share on other sites More sharing options...
tsubasaleguedin Posted April 6, 2006 Share Posted April 6, 2006 regexp? Link to comment Share on other sites More sharing options...
LePhasme Posted April 6, 2006 Share Posted April 6, 2006 Tu lis a partir du premier chiffre après la guillement fermante ou la parenthèse fermante et juqu'au dernier chiffre avant le premier * Edit : Raté ca fonctionne pas Link to comment Share on other sites More sharing options...
NiTrOuS Posted April 7, 2006 Author Share Posted April 7, 2006 C'est bon j'ai trouvé, merci quand même Dim position As Integer = InStr(line, ")") Dim date1 As Date = line.Substring(position) Dim date2 As Date = Replace(date1, " ** Error **", "") Je cherche la position de la parenthèse. Je supprime tout ce qui se trouve dans le string jusqu à cette position. Ensuite je retire le ** Error ** Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.