PC Review


Reply
Thread Tools Rate Thread

how do I import a list of music file names into excel

 
 
davydahl
Guest
Posts: n/a
 
      13th Apr 2008
I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      13th Apr 2008
You need a macro. Change the folder and file extension in the code below

Sub get_files()

Extension = "*.xls"
Folder = "C:\temp"
First = True
RowCount = 1
Do
If First = True Then
FName = Dir(Folder & "\" & Extension)
First = False
Else
FName = Dir()
End If
If FName <> "" Then
Range("A" & RowCount) = FName
RowCount = RowCount + 1
End If
Loop While FName <> ""

End Sub



"davydahl" wrote:

> I want to print a list of music files that I have in a folder on my hard
> drive. How do I import only the file names into excel?

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      13th Apr 2008
Several methods to accomplish this.......I like Tushar's best if importing to
Excel.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default...EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom
features.

OR Go to Command prompt and chdir to the folder with the files
Type DIR >MYFILES.TXT

All the above create a *.TXT file which can be opened in Notepad and printed.

One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-ins>Directory
Listing.

Download the ZIP file and un-zip to your Office\Library folder.


Gord Dibben MS Excel MVP


On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
<(E-Mail Removed)> wrote:

>I want to print a list of music files that I have in a folder on my hard
>drive. How do I import only the file names into excel?


 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      13th Apr 2008
Gord: What do you think of this change to your code?

@echo off
dir %1 /-p /o:gn > "%temp%\Listing.csv"
start excel "%temp%\Listing.csv"
del "%temp%\Listing.csv"
exit

"Gord Dibben" wrote:

> Several methods to accomplish this.......I like Tushar's best if importing to
> Excel.
>
> To add a "Print Directory" feature to Explorer, go to
> this KB Article.
>
> http://support.microsoft.com/default...EN-US;q272623&
>
> Or you can download Printfolder 1.2 from.....
>
> http://no-nonsense-software.com/freeware/
>
> I use PF 1.2 and find it to be more than adequate with custom
> features.
>
> OR Go to Command prompt and chdir to the folder with the files
> Type DIR >MYFILES.TXT
>
> All the above create a *.TXT file which can be opened in Notepad and printed.
>
> One more method if you want to by-pass the *.TXT file and pull
> directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
> and sorting once you have the data in Excel.
>
> http://www.tushar-mehta.com/ scroll down to Add-ins>Directory
> Listing.
>
> Download the ZIP file and un-zip to your Office\Library folder.
>
>
> Gord Dibben MS Excel MVP
>
>
> On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
> <(E-Mail Removed)> wrote:
>
> >I want to print a list of music files that I have in a folder on my hard
> >drive. How do I import only the file names into excel?

>
>

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      13th Apr 2008
The dir has too many options. When excel reads the date it put the data into
multiple cells. This works better

dir %1 /b /o:n > "%temp%\Listing.csv"

"Joel" wrote:

> Gord: What do you think of this change to your code?
>
> @echo off
> dir %1 /-p /o:gn > "%temp%\Listing.csv"
> start excel "%temp%\Listing.csv"
> del "%temp%\Listing.csv"
> exit
>
> "Gord Dibben" wrote:
>
> > Several methods to accomplish this.......I like Tushar's best if importing to
> > Excel.
> >
> > To add a "Print Directory" feature to Explorer, go to
> > this KB Article.
> >
> > http://support.microsoft.com/default...EN-US;q272623&
> >
> > Or you can download Printfolder 1.2 from.....
> >
> > http://no-nonsense-software.com/freeware/
> >
> > I use PF 1.2 and find it to be more than adequate with custom
> > features.
> >
> > OR Go to Command prompt and chdir to the folder with the files
> > Type DIR >MYFILES.TXT
> >
> > All the above create a *.TXT file which can be opened in Notepad and printed.
> >
> > One more method if you want to by-pass the *.TXT file and pull
> > directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
> > and sorting once you have the data in Excel.
> >
> > http://www.tushar-mehta.com/ scroll down to Add-ins>Directory
> > Listing.
> >
> > Download the ZIP file and un-zip to your Office\Library folder.
> >
> >
> > Gord Dibben MS Excel MVP
> >
> >
> > On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
> > <(E-Mail Removed)> wrote:
> >
> > >I want to print a list of music files that I have in a folder on my hard
> > >drive. How do I import only the file names into excel?

> >
> >

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      13th Apr 2008
If I want a listing, I use Tushar's add-in.

Feel free to add any options to the DIR command.

Gord

On Sat, 12 Apr 2008 21:25:00 -0700, Joel <(E-Mail Removed)> wrote:

>Gord: What do you think of this change to your code?
>
>@echo off
> dir %1 /-p /o:gn > "%temp%\Listing.csv"
> start excel "%temp%\Listing.csv"
> del "%temp%\Listing.csv"
> exit
>
>"Gord Dibben" wrote:
>
>> Several methods to accomplish this.......I like Tushar's best if importing to
>> Excel.
>>
>> To add a "Print Directory" feature to Explorer, go to
>> this KB Article.
>>
>> http://support.microsoft.com/default...EN-US;q272623&
>>
>> Or you can download Printfolder 1.2 from.....
>>
>> http://no-nonsense-software.com/freeware/
>>
>> I use PF 1.2 and find it to be more than adequate with custom
>> features.
>>
>> OR Go to Command prompt and chdir to the folder with the files
>> Type DIR >MYFILES.TXT
>>
>> All the above create a *.TXT file which can be opened in Notepad and printed.
>>
>> One more method if you want to by-pass the *.TXT file and pull
>> directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
>> and sorting once you have the data in Excel.
>>
>> http://www.tushar-mehta.com/ scroll down to Add-ins>Directory
>> Listing.
>>
>> Download the ZIP file and un-zip to your Office\Library folder.
>>
>>
>> Gord Dibben MS Excel MVP
>>
>>
>> On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
>> <(E-Mail Removed)> wrote:
>>
>> >I want to print a list of music files that I have in a folder on my hard
>> >drive. How do I import only the file names into excel?

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export list of table names to an excel file parth Microsoft Access 1 21st Mar 2007 03:41 PM
File Names: List Long file Names from Database List of short file names Ben Microsoft VB .NET 4 6th May 2006 01:20 AM
Can I import a list of data and make those new file names? =?Utf-8?B?bGliZXlAZGV3YWF5Lm5ldA==?= Microsoft Access External Data 1 11th Jan 2006 09:00 PM
how do i import a file list in to excel =?Utf-8?B?bGlhbQ==?= Microsoft Excel Misc 1 25th Jun 2005 11:16 PM
Getting a list of file names from Windows Explorer into Excel Steve M Microsoft Excel Worksheet Functions 3 3rd Dec 2003 07:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:12 PM.