By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Copying root directory

P: n/a
G'day ppl

Is there a process whereby I can copy the text labels of all the files in a
root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark
Dec 17 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
G'day ppl

Is there a process whereby I can copy the text labels of all the files in a root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark


Mark, I think you might have posted this to the wrong newsgroup. This group
is for support of Microsoft Access, the desktop database application.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

Dec 17 '05 #2

P: n/a
G'day Randy & thx for your reply.

Totally aware of the NG, my dilemma is that I want to import the root
directory file labels into a table, hence the reason I am posting in an
access forum.

Cheers.
Mark.

*** Sent via Developersdex http://www.developersdex.com ***
Dec 17 '05 #3

P: n/a
I think your looking for something like

dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
debug.print strname
strname = dir
loop

--
Terry Kreft

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
G'day ppl

Is there a process whereby I can copy the text labels of all the files in
a root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark

Dec 17 '05 #4

P: n/a
Oops, sorry. Bad assumption on my part.

The code that Terry provided should do nicely, just substitute an insert for
the debug.print.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
"Mark Lind" <no******@iprimus.com.au> wrote in message
news:q3************@news.uswest.net...
G'day Randy & thx for your reply.

Totally aware of the NG, my dilemma is that I want to import the root
directory file labels into a table, hence the reason I am posting in an
access forum.

Cheers.
Mark.

*** Sent via Developersdex http://www.developersdex.com ***


Dec 17 '05 #5

P: n/a
Thx Randy & Terry

Although Terry, code did not work, though I have no idea if I did it correct
or not.

I paste the code behind the OnClick of a cmdbtn but zip happened.

here's the deal:

Using this code, I would like it to collect the info that is displayed in
the explorer view of a folder.

this info would be:
Name/Size/Type/Duration..........etc...etc..
I am building a jukebox/library of all the mp3/mpeg/dvd I have on my system,
and don't really want to have to pain stakingly input every one of them.

Thx again
Mark.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:0b********************@karoo.co.uk...
I think your looking for something like

dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
debug.print strname
strname = dir
loop

--
Terry Kreft

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
G'day ppl

Is there a process whereby I can copy the text labels of all the files in
a root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark


Dec 18 '05 #6

P: n/a
Well I think you're missing where the output is going.

After you click the button press Ctrl-G on the keyboard that will take you
to the Immmediate window where you should see the file names listed.

--
Terry Kreft

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
Thx Randy & Terry

Although Terry, code did not work, though I have no idea if I did it
correct or not.

I paste the code behind the OnClick of a cmdbtn but zip happened.>>

<SNIP>
TIA
Mark




Dec 19 '05 #7

P: n/a
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...

'--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing

Dec 19 '05 #8

P: n/a
Whoops, slight error there piet. It should be as below except

do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update

strname = dir ' Get thye next one after you've written to the recordset
loop


--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
'--specify where the information is going to go...

dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing

Dec 19 '05 #9

P: n/a
sorry, that's what happens when you write off the top of your head in
notepad...

Dec 19 '05 #10

P: n/a
Don't I know it <g>.

..MoveNext the bane of my life. If I get a bug in a recordset iteration it's
because I've missed that line by typing faster than I can think (and I don't
type fast <g>).

--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
sorry, that's what happens when you write off the top of your head in
notepad...

Dec 20 '05 #11

P: n/a
Terry & Piet.

Firstly, Seasons greetings to both you and your families.

Thank you so much, between the 2 of you I managed to piece it together.

I would like to go 2 steps further if you can assist:

I think this is a big ask & will test you.. :-)

1. I need to copy a portion of text from 1 field to another. eg "Tom Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop fashion
to do all records that match this type of criteria.

2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the windows
explorer.

Thx again.

TIA
Mark.
"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except

do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update

strname = dir ' Get thye next one after you've written to the
recordset
loop


--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...

dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing


Dec 22 '05 #12

P: n/a
I managed to fix no.1 by parsing the text using Left$ & Right$, so thats
cool.

thx again
Mark
"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
Terry & Piet.

Firstly, Seasons greetings to both you and your families.

Thank you so much, between the 2 of you I managed to piece it together.

I would like to go 2 steps further if you can assist:

I think this is a big ask & will test you.. :-)

1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones - She's A Lady"... I would like to cut "Tom Jones - " delete the 2
spaces & dash then paste "Tom Jones" into the new field, structured in a
loop fashion to do all records that match this type of criteria.

2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows explorer.

Thx again.

TIA
Mark.
"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except

do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update

strname = dir ' Get thye next one after you've written to the
recordset
loop


--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing



Dec 22 '05 #13

P: n/a

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the windows
explorer. "Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except
do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
strname = dir ' Get thye next one after you've written to the
recordset
loop <pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
'--Borrowed from Terry Kreft...
dim strName as string
strname = Dir("c:\*.*")
do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop
rs.close
set rs=nothing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 22 '05 #14

P: n/a
G'day chuck,

Thx for replying, I actually have imported all the file names already, I was
hoping there was a way of extracting the tagged info that accompanies mp3
files.

unless there is another program that can store tag info & export in
tab/comma delimited.

thx again.
Mark

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:32********************************@4ax.com...

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop
fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows
explorer.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except
do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
strname = dir ' Get thye next one after you've written to the
recordset
loop <pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
'--Borrowed from Terry Kreft...
dim strName as string
strname = Dir("c:\*.*")
do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop
rs.close
set rs=nothing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 23 '05 #15

P: n/a

Check out the Tag & Rename program. It will do exactly that!

http://www.softpointer.com/tr.htm

I think it's about $25.

If you want to do it all inside Access, there are a couple of MP3
class files on the web that can do this, but the tag&rename program is
a lot nicer to use, and has a bunch of nice features already built-in
that you won't have to program in.

I have the Tag&&Rename program myself (I'm a user, I didn't write it)
and use it for editing the tags and exporting the tag information to a
CSV, then I import the data into my MP3 Database in Access/SQL.

I spent quite a bit of time doing it all myself with my own code, but
in the end it was just easier and simpler to do it with the Tag&Rename
program (which will also link up with a couple of CD Libraries on the
web and grab information for you.)

On Fri, 23 Dec 2005 20:30:49 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thx for replying, I actually have imported all the file names already, I was
hoping there was a way of extracting the tagged info that accompanies mp3
files.
unless there is another program that can store tag info & export in
tab/comma delimited. "Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:32********************************@4ax.com.. .

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop
fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows
explorer.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except
do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
strname = dir ' Get thye next one after you've written to the
recordset
loop

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
> I've done this... essentially all you need to do inside the loop is
> indicate where the data is going...
> > '--specify where the information is going to go...
> dim rsFiles as DAO.recordset
> set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
> '--Borrowed from Terry Kreft...
> dim strName as string
> strname = Dir("c:\*.*")
> do while len(strname) > 0
> 'debug.print strname
> strname = dir
> '--Write to table...
> rs.AddNew
> rs.Fields("FileName")=strname
> rs.Update
> loop
> rs.close
> set rs=nothing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 23 '05 #16

P: n/a
Thx heaps chuck, I'll get strait on it after my new year hangover.

reg's
Mark.

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:7m********************************@4ax.com...

Check out the Tag & Rename program. It will do exactly that!

http://www.softpointer.com/tr.htm

I think it's about $25.

If you want to do it all inside Access, there are a couple of MP3
class files on the web that can do this, but the tag&rename program is
a lot nicer to use, and has a bunch of nice features already built-in
that you won't have to program in.

I have the Tag&&Rename program myself (I'm a user, I didn't write it)
and use it for editing the tags and exporting the tag information to a
CSV, then I import the data into my MP3 Database in Access/SQL.

I spent quite a bit of time doing it all myself with my own code, but
in the end it was just easier and simpler to do it with the Tag&Rename
program (which will also link up with a couple of CD Libraries on the
web and grab information for you.)

On Fri, 23 Dec 2005 20:30:49 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thx for replying, I actually have imported all the file names already, I
was
hoping there was a way of extracting the tagged info that accompanies mp3
files.
unless there is another program that can store tag info & export in
tab/comma delimited.

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:32********************************@4ax.com. ..

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces
&
dash then paste "Tom Jones" into the new field, structured in a loop
fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows
explorer.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
> Whoops, slight error there piet. It should be as below except
> do while len(strname) > 0
> 'debug.print strname
> '--Write to table...
> rs.AddNew
> rs.Fields("FileName")=strname
> rs.Update
> strname = dir ' Get thye next one after you've written to the
> recordset
> loop

> <pi********@hotmail.com> wrote in message
> news:11**********************@o13g2000cwo.googlegr oups.com...
>> I've done this... essentially all you need to do inside the loop is
>> indicate where the data is going...
>> > '--specify where the information is going to go...
>> dim rsFiles as DAO.recordset
>> set rsFIles =
>> DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
>> '--Borrowed from Terry Kreft...
>> dim strName as string
>> strname = Dir("c:\*.*")
>> do while len(strname) > 0
>> 'debug.print strname
>> strname = dir
>> '--Write to table...
>> rs.AddNew
>> rs.Fields("FileName")=strname
>> rs.Update
>> loop
>> rs.close
>> set rs=nothing
--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 30 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.