// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; class MainClass { public static void Parse(string line) { string protection = line.Substring(0, 10).Trim(); string owner = line.Substring(11, 19).Trim(); int size = int.Parse(line.Substring(32, 8).TrimEnd()); string tim = line.Substring(40, 12).Trim(); string filename = line.Substring(53).Trim(); Console.WriteLine(filename + " " + size + " " + tim); } public static void Main(string[] args) { Parse("drwxr-xr-x 1 ftp ftp 0 Sep 01 19:38 Adobe Illustrator 10"); Parse("drwxr-xr-x 1 ftp ftp 0 Sep 07 09:36 subdir"); Parse("-rw-r--r-- 1 ftp ftp 1871872 Sep 07 11:52 a.zip"); Parse("-rw-r--r-- 1 ftp ftp 21814474 Sep 07 09:53 z.zip"); } }