Since I finally got it working, I figured I let everyone here on the
highlights:

Given this interface defining the layout of a fixed-field text file

public interface Dir
{
        [FixedField(0, 20)]
        DateTime ModDate { get; }

        [FixedField(24, 5)]
        string IsDir { get; }

        [FixedField(29, 9)]
        int Size { get; }

        [FixedField(38, 40)]
        string Name { get; }
}

Then this works:

var tb = new TextFileLinq<Dir>(@"C:\xxx.txt");

var q = from t in tb
        where t.Size > 0 && t.ModDate > DateTime.Now.AddYears(-2)
        select new
       {
           Line = ((IRow)t).Line,
           ModDate = t.ModDate,
           IsDir = t.IsDir,
          Size = t.Size,
          Name = t.Name
        };

foreach(var t in q)
{
    Console.WriteLine("{0}, {1}, SIZE={2}, {3}", t.Line, t.Name,
t.Size, t.ModDate);
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to