Reply To: TCL – Storing Input FileName into a variable

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf TCL – Storing Input FileName into a variable Reply To: TCL – Storing Input FileName into a variable

#59838
garry r fisher
Participant

    Hi,

    You could get the names of the files using glob to read the directory and then use the ‘file’ commands to extract the relevant information.

    set fileDir E:Target

    cd $fileDir #use catch to trap any errors

    for each filename [glob -nocomplain *] {

       set fname [file root $filename]

    }

    There are other commands such as file tail, file extension etc which may be of use to you.

    Regards

    Garry