' 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) 
Imports System

Class MainClass
    Public Shared Function Eater(ByVal line As String, ByVal ix As Integer, ByVal n As Integer) As String
        Dim res As String = ""
        Dim line2() As Char = line.ToCharArray
        Dim ws As Integer = 0
        Dim i As Integer
        For i = 1 To (line2.Length - 1)
            If line2(i) = " " And line2(i-1) <> " " Then
                ws = ws + 1
            End If
            If ws >= ix And ws < (ix + n) Then
                res = res & line2(i)
            End If
        Next
        Eater = res.Trim
    End Function
    
    Public Shared Sub Parse(ByVal line As String)
        Dim protection As String = Eater(line, 0, 1)
        Dim owner As String = Eater(line, 1, 3)
        Dim size As Integer = Integer.Parse(Eater(line, 4, 1))
        Dim tim As String = Eater(line, 5, 3)
        Dim filename As String = Eater(line, 8, 100)
        Console.WriteLine(filename & " " & size & " " & tim)
    End Sub

    Public Shared Sub Main(ByVal args As String())
        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")
    End Sub
End Class 
