
function extract(input)
    f = open(input, "r")
    #CHECK FILE TYPE
    occursin("ooTextFile", readline(f)) ? print("Successuflly opened ooTextFile") : print("File type NOT: \"ooTextFile")#line#1
    #CHECK OBJECT CLASS
    if !(readline(f) == "Object class = \"TextGrid\"")#line#2
     throw(UndefVarError(:NotTextGridFile))
    end
    readline(f)#SKIP BLANK LINE (line#3)
    #READ START TIME
    xmin = parse(Float64,readline(f)[8:end])#line#4
    #READ END TIME
    xmax = parse(Float64,readline(f)[8:end])#line#5
    #READ TIERS INFO
    tiers = occursin("tiers? <exists>", readline(f))#line#6
    tierSize = parse(Int64,readline(f)[8:end])#line#7
    #CREATE VECTOR VARIABLES
    class = Array{String}(undef, 1, tierSize)
    name = Array{String}(undef, 1, tierSize)
    xmin = Array{Float64}(undef, 1, tierSize)
    xmax = Array{Float64}(undef, 1, tierSize)
    intervalSize = Array{Int64}(undef, 1, tierSize)
    interval = Vector{Vector}(undef, tierSize)
    readline(f)#SKIP "item[]" (line#8)
    for i in 1:tierSize
        readline(f)#SKIP "item[i]" (line#9....)
        class[i] = readline(f)[18:end-2]#
        #println("class: " * readline(f)[18:end-2])
        #name[i] = readline(f)[17:end-2]#
        println("name: " * readline(f)[17:end-2])
        #xmin[i] = parse(Float64,readline(f)[15:end])#
        println("xmin: " * readline(f)[15:end])
        #xmax[i] = parse(Float64,readline(f)[15:end])#
        println("xmax: " * readline(f)[15:end])
        #intervalSize[i] = parse(Int64,readline(f)[26:end])#
        if occursin("IntervalTier", class[i])
            intervalSize[i] = parse(Int64,readline(f)[26:end])#println("intervalSize: " * readline(f)[26:end])
        else
            intervalSize[i] = parse(Int64,readline(f)[23:end])
        end
        #println("intervalSize: " * intervalSize[i])
        intervalLines = Vector{Any}(undef,intervalSize[i])
        println("tier#",i)
        for j in 1:intervalSize[i]
            #println(readline(f),readline(f),readline(f),readline(f),"\n")
            readline(f)#SKIP "intervals [j]:" (line#15)
            #println([readline(f)[19:end],readline(f)[19:end],readline(f)[21:end-2]])
            if occursin("IntervalTier", class[i])
                intervalLines[j] = [parse(Float64,readline(f)[19:end]),
                                    parse(Float64,readline(f)[19:end]),
                                    readline(f)[21:end-2]]
            else
                intervalLines[j] = [parse(Float64,readline(f)[21:end]),
                                    readline(f)[21:end-2]]
            end
            #append!(interval,[readline(f)[19:end],readline(f)[19:end],readline(f)[21:end-2]])
            if(j == intervalSize[i])
                interval[i] = copy(intervalLines)
            end
        end
    end
    interval end
