in reply to Re: Building a UNIX path from Irritating data
in thread Building a UNIX path from Irritating data

Hi GrandFather -- Thanks for the suggestion. I tried your code and it works as you mentioned, but I tried the same code with a static data file from the application itself (I posted a copy here: subfolders.txt), and the list never got past the first "/foldername". I'm looking into that to find out why.

However, I also don't see in your code how deep the paths could go. Some of these folder/subfolder relationships go down 5 or 6 levels so we could see something like this:

/foldername_ten/foldername_eleven/foldername_twelve/foldername_thirteen/foldername_fourteen

It looks like your code only handles the first level of subfolder. Is that correct?

For an example of how this data could be nested, search for folder ID 3053 in the linked datafile above and tell me if your code could address the structure seen there. Thank you for your assistance!

  • Comment on Re^2: Building a UNIX path from Irritating data

Replies are listed 'Best First'.
Re^3: Building a UNIX path from Irritating data
by GrandFather (Saint) on Nov 26, 2009 at 01:23 UTC

    There is no inherent limit to how nested the folders may be.

    I tried your data and it seemed to work fine for me generating over 3000 lines of output. Could you have a line ending issue? If you are running the script on *nix, but the file is generated on Windows then the line ends generated (cr/lf) won't match those expected (lf).

    I notice that some of the names have / characters in them (Folder 7969 for example). That is likely to cause you grief if you use the names as folder names.

    It looks to me like you really need a database solution to this problem instead of a file based solution.


    True laziness is hard work