Reading one of my friend’s blog the other day i stumbled onto this title: “How to copy Multiple Files/Folder names in bulk to Notepad file“. I remember my self wanting to write a small app that would do that exact thing because i needed it a couple of times. At that time i decided not to waste any time on it since i thought that no one would need it actualy. But reading this post i was convinced i should write it since it could be usefull. It took me about an hour and here is what i came up with.
This application actualy lists the contents of a given folder (recursivly or not) into a plain text file or into an EXCEL spreadsheet. I know that those commercial software do a bit more but i think it’s just to show off without any meaning what so ever. To run this small application you need the Java Runtime Environment 6 or better (with older version it won’t work because i used 6 to compile it). You can get the JSE6 here.
There are two batch files included. The first one is called “recompile.bat” which actualy recompiles the source. You should need this if you have an older Java version. The other one is called “run.bat” which actualy runs the program (provided that you have JSE6 available). Running with this bat is actually the interactive mode where the program will ask you questions on what you need. You can run the program to produce the output directly by passing in the options like this “java FileExporter folder recursive excludeFolders xlsOutput showSize showModified outputFile“. Let’s take a quick look on each one of them:
- folder: The folder to start scanning from. It can be either relative (for instance “.”) or absolute (like “c:\”).
- recursive: The values can be “true” or “false”. This indicates whether to perform a recursive search or not. Be careful though, if you order a recursive search on “c:\” for instance this could take A LOT of time (and for many sub-folders the program could crash). This is because i didn’t optimize it for big recursive search.
- excludeFolders: Indicate either to exclude the folders themselves from the list or not. For instance if you have a sub-folder called “foo” and in there more files, do you want “foo” to appear on the list or not? Values can be “true” or “false”.
- xlsOutput: Either export on excel format or text. Values can be “true” or “false”.
- showSize: Add a column with the file size or not. Values can be “true” or “false”.
- showModified: Show the last modified date or not. Values can be “true” or “false”.
- outputFile: The file to output the result. For your convenience if you choose to output on excel name the file with an “.xls” on the end or if you want to export on text then add “.txt”.
You can download the program here: [download#2#size].
Woow :O
Downloaded this…
I have no knowledge about Java :/ (Don’t know the reason but I am involved in other stuffz that I dont have time to learn them)
Now I can see 6 files in which their are 2 MS dos batch files..
How do I get started ? Should I place the folder in the other folder or Should I run some files (I used “Run”..I guess something did happen 😀 but I don’t know wat was it 😡 )
Lemme know mate 🙂 This will be a better alternative that the software as it is small in size 🙂
Thanks for creating a cute program 😀
well all you do is click on run. the proper run should be to start asking you the folder etc If it didn’t ask then the most probable reason is that you don’t have Java installed or it’s older than JSE6. to make sure why don’t you run again and copy/paste what you get on your command prompt (right click, mark and then select the text to copy and press enter).
let me know of the results 😉
Run disappears automatically :O
I copied
E:\Documents and Settings\sidddd\Desktop\file_exporter>java FileExporter
‘java’ is not recognized as an internal or external command,
operable program or batch file.
E:\Documents and Settings\sidddd\Desktop\file_exporter>pause
Press any key to continue . . .
MY OS is in E drive 😡 …
I never knew I had outdated Java environment!
my friend sid i think you don’t have java at all. go check if you have the folder “E:\Program Files\Java”. There shouldn’t be that folder at all. Please download java from the link on the post, install and try again mate. let me know if you run into any problems again…
A really useful piece of code! I, too was planning to write something like that, but like you, had no time to do it.
Thanks, the program owns
By the way, nice blog!
thx on all the points 😉
I have javacore installed on E default drive –> program files …
Should I install Java ?
Hmm.. My PC is almost outdated (Must buy a new one.. hehe) 😀
It is seems that it works fine!…
But,why don’t you try to use (or to create) some kind of UI?
I have no idea about Java and how difficult could that be,but it would be for sure more user-friendly!…
@rockstar sid: yah you should install java man (the JSE i am talking about in the post)… sorry 🙁 try installing there should be no problem.
@#FN$# : UI is pretty simple in java… there will be a crash course on it 😉 but i was actually bored to code it 🙂
Aha!
Quite bored or quite busy???
😛
Now, I know!! xD
thats reflecting hard work of yours, nice blog you have out there and seems like nice java knowledge your main page is full of java posts 😉
thx… well i know some stuff about Java and i like posting stuff here… especialy the crash course series…
Cool post.. Write more on java and other programming language techniques..
I like your blog.. especially the logo.. hehe
once again nice post on the series 😉
what abt the idea of turning them into a ebook after some time ??
that would be nice i guess… when i finish the core i’ll see into it. nice idea!
Nice work. I would be happy to look at the source code if you are willing to provide it.
the source is provided with the download. in the archive is the executable along with the source code. if you have any suggestion or problem report back to me!