I have directory listing in excel like:

C:\temp\abc.doc
C:\temp\bvs.doc
C:\temp\temp1\abc.doc
C:\temp\tempkasfcdsafdf\jdkg.xls

how can i use the mid function to get only

C:\temp\
C:\temp\
C:\temp\temp1\
C:\temp\tempkasfcdsafdf\

basically the path minus the actual filename? Thanks