Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting DOS directory file/date/size info into excel 2

Status
Not open for further replies.

comdata

Technical User
Jun 30, 2003
155
US
Prior thread96-1407271 provided file name output to excel.

However, I also need the create date in addition to the filename.

Thus far - in a command prompt window:
DIR /T:C X:\*.pst>pstlist.txt
Provides files with PST extension on X: drive

But I haven't been able to get the Create date to be included in the txt file to pull into excel...

TIA

Alex
 
Show what the txt file looks like.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Glenn,

I went back & tried again... I realized that my import into excel included some preliminary lines of text that
looked as if only the Directory path and file name were present in the incoming text file.

Now when I tried again to document a few print screens,
I see that indeed, further down in the text file the
Date/Time created as well as the filenames were present.


Thanks for having me review it again...
 
DIR X:*.pst /T:C > pstlist.txt


Member- AAAA Association Against Acronym Abusers
Only here temporarily during job transition....again....but better this time.
 
Hi, Comdata

How about this procedure:

- DIR /T:C X:\*.pst | find ".pst">pstlist.csv

This filters out all lines that don't contain .pst in them.

- Edit pstlist.csv in notepad and replace all double spaces with single spaces. Do it until there are no double spaces left.

- Replace all commas with nothing to eliminate commas.

- Replace all single spaces with commas

- Save the file

- Open pstlist.csv into Excel as a CSV file

This will give you

Date in Col A
Time on Col B
AM/PM in Col C
File Size in Col D
File Name in Col E

Assuming you are using default time display.

Jock
 
Hi Jock,

wouldn't that have problems with files with embedded spaces in the name?

If you pipe the output to a txt file Excel then guesses the widths fairly well ( Fixed Width instead of Delimited ), without having to mess around in an editor anyway.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Thanks Glenn,

It did work as you said by importing into excel (Fixed width) = and the song titles with embedded spaces came out
fine because during the import, I could indicate where to parse.

Have a Great Day!!!

Deb
 
Hi, Glenn

Right you are, I never use spaces in filenames so didn't think of that wrinkle.

Jock
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top