Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.

sxz



185 posts

Master Geek


Topic # 101802 9-May-2012 09:38 Send private message

I have made a list of the contents of a folder using the DOS commands.  I have 600 odd files in 300 odd sub directories.

I need to make a good looking table of contents, i.e. the style I would have in Microsoft Word using the Heading 1, Heading 2, Heading 3 options.

My problem is that the list that DOS spit out is 40 pages long, and will require me going through line by line and deleting the date, time and file size of each document, then organising into a proper list that can give me the table of contents.

My question is - is there a program / better way of doing this or do I need to put in the grunt work?  It seems very repetitive, and it seem like it would be simple to make software to do it (if I could actually make software to do it).  Could be a good way to make $ for someone?

Create new topic
627 posts

Ultimate Geek

Trusted

  Reply # 622095 9-May-2012 10:00 Send private message

If you're doing it from a command prompt, something like this might help:
dir /s /b c:\Temp >results.txt
That should give you a clean list of file names & paths for the C:\Temp directory and all subdirectories

A better way would be to create a VBA script to list the contents of a directory.

Here's a VBscript that does the job, shouldn't be too difficult to convert it to a VBA: http://blogs.technet.com/b/heyscriptingguy/archive/2004/10/20/how-can-i-get-a-list-of-all-the-files-in-a-folder-and-its-subfolders.aspx




Stuart Maxwell
Choice Mobile (2degrees Authorised Dealer)
Choice Technology (Managed IT Services)


1247 posts

Uber Geek


  Reply # 622127 9-May-2012 11:29 Send private message

Use the Tree command and pipe it to a text file

Tree > tree.txt



sxz



185 posts

Master Geek


  Reply # 622132 9-May-2012 11:39 Send private message

Thanks for the advice - but I dont really know how to code and do the more complicated stuff like that (I had to read a few articles to remember how to even use the command prompt to print it out).  Are their easier options?

451 posts

Ultimate Geek


  Reply # 622138 9-May-2012 11:49 Send private message

Could you first import the list into excel, do the tweaking in there to get rid of the extra info, and then paste it into word?

451 posts

Ultimate Geek


  Reply # 622577 9-May-2012 22:12 Send private message

Or you could paste the file paths first into notepad++, which has some powerful find and replace tools that are quite easy to learn

451 posts

Ultimate Geek


  Reply # 624899 14-May-2012 14:45 Send private message

Or you could try using Notepad++ , it has powerful find and replace functions for that kind of task.

Create new topic
Twitter »
Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when new jobs are posted to our jobs board:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:




News »

Trending now »
Hot discussions in our forums right now:

Fecked up religious people strike again :-(
Created by Mark, last reply by freitasm on 25-May-2013 08:44 (85 replies)
Pages... 4 5 6


Cannabis is illegal yet we have really strong 'legal highs' ?
Created by qwerty7, last reply by freitasm on 23-May-2013 23:20 (74 replies)
Pages... 3 4 5


A new project coming to Geekzone
Created by freitasm, last reply by l43a2 on 24-May-2013 23:02 (342 replies)
Pages... 21 22 23


Xbox One
Created by DjShadow, last reply by nathan on 25-May-2013 22:40 (75 replies)
Pages... 3 4 5


HTC One (2013) owners' discussion
Created by Dingbatt, last reply by mrgsm021 on 25-May-2013 14:30 (1567 replies)
Pages... 103 104 105


Monolithic Cement Sheet cladding mid 80s house - "leaky home" or not?
Created by joker97, last reply by mattwnz on 24-May-2013 23:46 (15 replies)

Orcon, Is this for real or a scam??
Created by old3eyes, last reply by DarthKermit on 22-May-2013 19:12 (29 replies)
Pages... 2


Entire house HTPC concept
Created by InfiniteLoop, last reply by darthmeow on 24-May-2013 12:19 (26 replies)
Pages... 2



Geekzone Jobs »
Most recent NZ jobs in technology:

Developer of interactive experiences
Posted 25-May-2013 21:28

Ambitious Project Coordinator
Posted 25-May-2013 19:28

Ambitious Project Coordinator
Posted 25-May-2013 19:28

Exceptional Senior Project Manager
Posted 25-May-2013 19:28

Multitalented Business Analyst
Posted 25-May-2013 18:28

Communicative Test Manager
Posted 25-May-2013 17:28

Flexible Test Manager
Posted 25-May-2013 17:28


Geekzone Live »
Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.