topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 4:36 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Looks like I still dont have a final solution for a custom directory list :(  (Read 6587 times)

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
dir /s /on /b /a:d > list.txt

This one is close, about as close as I have come.
the output though is "too complete" as I only need one line for each folder or better stated
I need one line showing the first occurrence of the file index.php, then skipping to the next subdirectory and listing the same thing there.

I convert these to web-links by reversing the "\" to "/" and replacing the c:\"path"\subdirectory\index.php with "http://www."/subdirectory/index.php in notepad.

I had tried a program someone suggested here and thought it was working but it turned out not to be quite what I needed.
The "dir" command with the listed switches almost did it, but it lists every subdirectory under the main one.

It would almost be easiest to just list all directories and going just 1 level deep.  Example Order: A, Aa, Ac, Ad, Ae,   B, Ba, Bb, Bc, Bd  D, Da,Db,Dc  etc.  Some may have  10 projects, some only 1. 
If I copuld even get this list I could still replace the front end of each and even add the necessary text "index.php" to the end.

This  is to create a clickable list of links that open webpages created by different people all stored on one main website.  Only the site owner can enter at the top level.  The others each have their own named folder containing all their projects.  Each project can be entered directly via the  "www.path/index.php". 

Several program I tried did TOO much, some not enough or had no easy way to save output as a text or preferably Word file (so the links would already be active)

Nothing fancy, just a quick list of clickable links and it seems I should be able to do it with the dir > command if I could just get the switches in the right order.  It is important that it not continue to list ALL the index.php files in each site as there are more than one.  The First one is the entry point.
the rest, I end up having to delete until it reaches the next subdirectory/first index.php file.  Etc.

Thanks for anyone knowing where to add the text to show only the first occurrence of that file.
OR  listing all the namedirs/subdirs but no further. 

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • View Profile
    • Donate to Member
Questorfla, since you didn't say which program you tried, did you try "Karen's Directory Printer" yet? It lets you turn off all info you don't need, saves the output pretty easily to text, and can work on either files with their path or folders.

http://www.karenware...ertools/ptdirprn.asp

I've used it for years and I have created "directory to web" projects myself too. (I like to do the shuffle in Excel with a template to add those extra characters etc.)


skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
It's still rather unclear exactly what you want in the end.  For requests such as these, it's imperative that you:

1) Provide a sample file structure.
2) Provide a sample of what you expect the output to look like given #1.


questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Sorry:  I tried to explain it as best I could.  I feel like the three blind men trying to describe an elephant with each touching a different part.
I really don't know any better way than what I have said.  And I have gotten a lot of help here.  The answer will undoubtedly be some kind of selectable directory listing program.  One of the ones I was given as one of the first replies does work after a fashion, I have to edit the output manually but  it does work.

Thanks to everyone for their input.  I may try the Karen's Directory List next.  It looks promising.  All the things I learn just from trying make the search well worth the effort.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
dir /s /on /b /a:d > list.txt

This one is close, about as close as I have come.
the output though is "too complete" as I only need one line for each folder or better stated
I need one line showing the first occurrence of the file index.php, then skipping to the next subdirectory and listing the same thing there.

It'll list every occurrence of index.php but maybe:

dir /s /on /b /a:-d index.php > list.txt

Otherwise, as skwire has said, we need an example input and example output to be able to get the right idea.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Sorry:  I tried to explain it as best I could.

That's the thing, if you can provide us with a sample of the directory structure you're working with, you won't have to explain it; we'll be able to visualise it.  So, in a new folder, build a small sample of what you work with.  Then, go to the root of this sample in a command prompt and use the "tree /a /f" command to display a nicely formatted output that we can interpret.  After that, give us an output based upon your sample directory.

In other words, show us your starting point and your ending point and we'll figure out the route between them.  =]

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • View Profile
    • Donate to Member
I'll try a different track:

I took a sample small directory set and did a filter for "New Text Document.txt"

Karen's Dir. Printer produced the following:

C:\Documents and Settings\user\Desktop\Data\New Text Document.txt
C:\Documents and Settings\user\Desktop\Data\Processed\New Text Document.txt
C:\Documents and Settings\user\Desktop\Data\Mon\New Text Document.txt

Aka it dug up only the copies of your file, and left the rest alone. Is that what you wanted?