Results 1 to 13 of 13
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Kent, Kent, United Kingdom
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wanted : Remove folder hierarchy

    I always come back here when I'm stumped! [img]/forums/images/smilies/tongue.gif[/img]

    Wanted! A program that will remove the folder folder hierarchy from a specific folder. i.e. All files within the specified folder will be brought back up to the highest folder level regardless of the sub folders they might have existed in. (Interesting questions about duplicate file names)

    Anybody have anything in mind that might do this?

    Thanks all

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Wanted : Remove folder hierarchy

    Haven't tried it but have a look at:

    File Sieve near the bottom of the page. <img src=/S/free.gif border=0 alt=free width=30 height=15>
    Jerry

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wanted : Remove folder hierarchy

    In general, that won't work.

    In addition to the file naming issue, there's the matter of, e.g., HTML files that include references to files in subdirectories.
    While these could be modified programmatically, there's still the issue of programs referring to subdirectories, and other types of files that might have links.

  4. #4
    Star Lounger
    Join Date
    Mar 2002
    Location
    Kent, Kent, United Kingdom
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wanted : Remove folder hierarchy

    Wow. Now that is an impressive response time!! (If only my project teams could get back to me so fast!) [img]/forums/images/smilies/smile.gif[/img]

    I note the issue about relative folder references within certain filetypes / programs. Luckily I can live with this as these are data files and have no dependence (The hierachy was anachy - I wanted to address and re organise)

    I'll take a look at the File Sieve, thanks for the pointer. I'll report back if it's good

    Cheers both - really appreciated

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Wanted : Remove folder hierarchy

    >In general, that won't work

    Howard, that is a very large generalisation. If it is a matter of "moving" documents to a higher level in a directory hierarchy, of course it can be done. If the was a dependency between the documents then it would be foolhardy to do it unless it was for archiving.

    If there was dependency then it would be just a matter of zipping or filing a whole directory or root folder set. Mentioning the HTML is, in my opinion, a blind alley as there would be not rhyme or reason to move these to upper level folder hierarchies as refential links would automatically be lost and you would more than likely do this within an application like Dreamweaver.
    Jerry

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wanted : Remove folder hierarchy

    Yes, but one could not generalize a program to do such moves.

    There's no way to know how to fix internal links, or when there are directory associations, such as with HTML files.

  7. #7
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Wanted : Remove folder hierarchy

    Yes but that WASN'T the question <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Jerry

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wanted : Remove folder hierarchy

    With those restrictions the task is easy.
    All code needs to is have a user identify a directory, then recursively walk the path backwards.
    But make sure prog is only used in cases where files have no dependencies,

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wanted : Remove folder hierarchy

    Ah shucks, make believe we are on Jeopardy.
    I gave the answer, now someone has to provide the question?

  10. #10
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Wanted : Remove folder hierarchy

    <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Jerry

  11. #11
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Wanted : Remove folder hierarchy

    If you want to do some work yourself (walk the folder structure), there was a script that some Loungers did for me back in Feb. I had asked for a capability to move (or copy) a file from one folder to its parent. I think there were some minor issues still open when we terminated the thread, like the duplicate file names. What you can do is highlight a bunch of files in a subfolder and then run the script; the files are moved to the subfolder's parent. See <post#=557494>post 557494</post#> for one of the posts on the thread; you should be able to go from there if this is useful.

    There were also some other ideas on that thread for file mgmt.

    Since that thread is pretty long, I could attach the script if you want it. I use it quite a bit but not for the same reasons you do.

    Fred

  12. #12
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wanted : Remove folder hierarchy

    Hello,

    Would it be possible to just use Windows Search on the root folder and leave the search term blank? The resulting list should include all the files, sort by type and then select all the files and drag them to a temporary folder. Then delete all the folders and copy the files back into the original folder. The downside is that if you have a lot of files with the same name you will get asked whether to replace a file lots of times.

    Chris (Hunt)

  13. #13
    Star Lounger
    Join Date
    Mar 2002
    Location
    Kent, Kent, United Kingdom
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wanted : Remove folder hierarchy

    Hi all
    Thanks for the comments (I will take a look at modifying that script)

    Cah. You are quite right, in fact that is what I have been doing... Just feels a little clumsy and I was interested if anybody had already dealt with this issue

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •