Open Text File And Sort

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2005
Posts: 45
Reputation: _r0ckbaer is an unknown quantity at this point 
Solved Threads: 7
_r0ckbaer's Avatar
_r0ckbaer _r0ckbaer is offline Offline
Light Poster

Re: Open Text File And Sort

 
0
  #11
Sep 25th, 2007
When you catch the exception you should output its message, and not "blabla..is not a valid image file". That way you'll be able to identify what's going wrong.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 9
Reputation: nullified is an unknown quantity at this point 
Solved Threads: 0
nullified nullified is offline Offline
Newbie Poster

Re: Open Text File And Sort

 
0
  #12
Sep 25th, 2007
I identified the debugger error....apart from that it is out of my league

but i got it working and it does what i want so i'll quit while im ahead i think

here is a link to the code for future reference....or for anyone thats interested.


http://files.filefront.com/LoginSort.../fileinfo.html
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 45
Reputation: _r0ckbaer is an unknown quantity at this point 
Solved Threads: 7
_r0ckbaer's Avatar
_r0ckbaer _r0ckbaer is offline Offline
Light Poster

Re: Open Text File And Sort

 
0
  #13
Sep 25th, 2007
Just for the gallery, see first part of code in my previous post:


string format = "MM.dd.yyyy HH:mm:ss";
lines.Sort(new Comparison<string>(delegate(string a, string b)
{
string dateA = Regex.Match(a, "\\[(.+)\\]").Groups[1].Value;
string dateB = Regex.Match(b, "\\[(.+)\\]").Groups[1].Value;

return (DateTime.Compare(DateTime.ParseExact(dateA, format, null),
DateTime.ParseExact(dateB, format, null)));
}));
Last edited by _r0ckbaer; Sep 25th, 2007 at 7:41 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC