jDirToText: Your files to Text

Today I bring you a simple program that I implemented a few months ago in Java and although I have shared it on other sites, I missed publishing it in the places I travel the most, here.

First of all we must have JAVA 7 installed in the system.

It is a program developed to automate the task of copying the file names of one or more directories into a text file (.txt)

UTILITY: For example, a radio station wants to share the names of the titles of a weekly ranking on some web page.

This program allows you to search the directory and make the automatic copy of the file names in a text file, saving us the work of copying it by hand.

Another example, a friend asks us to pass him a "list of song names," so we find our Music folder and run the program.

Works for one or more directories recursively.

Some screenshots:

156

38C

Mode of use

Within the program, we select the folder entry (the one we want to convert), and then the directory of output press convert, and voila 🙂

The program will automatically create a file called "FILES_LIST.txt"

To run it by console:

java -jar nombredelarchivo.jar

I hope it helps you 🙂

Download

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   davidlg said

    The power of bash
    $ ls / path_to_folder> output.txt

    you want to search for files with .mp3 extension (search recursively)
    $ find folder_to_lookup -name * .mp3

    1.    davidlg said

      the first shows the files and sends the output to the file output.txt

      the second looks for files with an .mp3 extension, to send them to a file it would be the same as before
      $ find folder_to_search -name * .mp3> output.txt

    2.    xykyz said

      That's what I was thinking, that with a «ls path> output.txt» you have it done and you can also use regular expressions to get images and music with, for example «ls path / *. {Mp3, jpg}> output.txt» .

      1.    Bruno cascio said

        Hello friends! Sure it can be done with bash. Deleting directories with subdirectories (for example) can also be done with bash, however many prefer to enter the file explorer and delete them with delete, and sometimes even worse, having to give them permissions before deleting.

        It is intended for any system, not just unix. Windows users do not have the same tools and even if they had them, they would not use them, because that is how they became enslaved, with a graphical interface.

        Thanks for the comments 🙂

    3.    Hugobuntux Aldebian said

      excellent but it can also be done with bash
      is a simple ls in folder or directory> filename.txt
      in winBugs it is similar
      Regards!

  2.   jvk85321 said

    If they only want the list of files they can use

    [code] ls -1> out.txt [/ code]

    Show only file names.

  3.   f3niX said

    The same thing that I was going to say, bash or python, some lines and you will not have to install anything else on the system. But the contribution is still appreciated and it would be better if you showed the code to those interested in learning a little.

    1.    Bruno cascio said

      Here the code: https://drive.google.com/file/d/0B8DT697Uja7RZFRNem9NM2JEUWM/edit?usp=sharing

      I will add it to the post. Thanks for comment .)

  4.   Joaquin said

    Hello! As you already mentioned, it would be good to learn a little about how Java programming is, but I think the most practical for us is to use bash in a single line 🙂

    I agree with what you say that not everyone likes to use the console, and that there is also the advantage of being multiplatform. And I wonder if it will be possible to do the same in Windows CMD and how, just as we do with Bash.

    Also thank you for sharing your work. From the title I thought it was a kind of filing cabinet that converted any type of file to text, but I did not understand why.

    1.    Bruno cascio said

      Hi Joaquin! Thanks for comment!

      I do not know the Windows Bash, rather I think that if a user uses a console 99% must be from linux / MAC, haha

      Intended for those users, is this program ... Much better even in performance is to use Bash, but it is a matter of taste, customs, etc.

      Regards!

  5.   Isaac diaz said

    Good contribution friend, it is certainly a good resource for those of us who like to mess around with code.

    You can also generate a list using the command »ls> list.txt» from the terminal.
    I love your blog and I don't miss any entry .. Thanks!

  6.   DMYSYS said

    Good idea, even if it's more to cackle than stop something else, it's good for those of us who like to look at code, thanks

  7.   Algave said

    Also if you want me to show you the list in a tree with all the directories and its content, it would be: tree Music> out.txt
    or put the full path:]
    tree / path /> out.txt