ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA - Extract folder and file paths from specified folders

(1/2) > >>

TalksToPCs:
Dear Coders,

I'm a non-programmer with only basic scripting skills.

I want to mass-extract file names from a folder and write them to a text file. The "\" in the path should be converted to "<". An AutoHotkey script would be great because there is a chance that I might be able to modify it.

Steps:
1. Select folder from a menu
2. Extract folder paths and convert them to my desired format:
P:\Z_Systems\Favoriten yields the following:
P:<Z_Systems<Favoriten<folder 1\folder 1
P:<Z_Systems<Favoriten<some other folder\some other folder
Mind that there should be a backslash after the actual folder name followed by the last folder name.
It should issue a warning should one of the paths have more than 127 characters. I will put in that warning by myself later.
...
3. Write these files to a text file that is saved on the desktop.
... That's it.

It would be kind of nifty if I would be able to select between files and folders at the beginning (either one or the other should be extracted, but not both).
P:<Z_Systems<Favoriten<file 1.doc\file 1.doc

Thank you so much!

skwire:
Would you like a GUI or is a single-run type of script sufficient?

skwire:
Here you go.  Select a folder, choose the desired radio button and click Go.  When it's done scanning the folder, it will prompt you for a filename to save to.  Two files will then be saved, one as your chosen name and the other with a "_long" addition.  That second file will contain the paths that are longer than 127 characters.  For instance, if you chose test.txt as your filename to save to, you would get a test.txt and a test_long.txt.

Download (source/binary included): http://skwire.dcmembers.com/apps/path_parser/Path_Parser.zip

IDEA - Extract folder and file paths from specified folders

TalksToPCs:
Thank you! It works great!  :D Check's in the mail...

I almost dare not ask but the underscores and file name extensions create some problems for me. (Sorry for not pointing out that earlier.)

Specifically,
P:\Z_Systems\Favoriten\file_1.doc

should turn into
P:<Z_Systems<Favoriten<file_1.doc\file 1

It would save me from having to use the find and replace function.

skwire:
So, to clarify:

1) When we add the filename or foldername to the end of the path, change any underscores to spaces.
2) Whilst in files mode, strip the extension.

Correct?

Navigation

[0] Message Index

[#] Next page

Go to full version