Need a script to collect file names from my Cloud Drive

Drive (google app) lists folders grouped together separate from zip files.

I’m going crazy having to manually type a list of file names and Sort in a spreadsheet. It took over an hour for 35 files. Keying in data on a phone is so painfil and error prone.

Could a Script pull the file names and sort?

Amazon already has that ability. I extracted book titles and author from my moms kindle library. Created a access database that I could print for her. I could tell her all the books she had by a specific author. Very helpful because she’s bought over 350 kindle books in the past 10 years.

Or maybe I need to purchase space on dropbox? I can’t use syncing because my phone doesn’t have the space for duplicates of my files. I download what I need, use it, and eventually delete off the phone.

Not a script, but a procedure to extract file names from a collection of files. This is for Windows - I don’t think this applies to smartphones:

  1. Select contents of folder
  2. Shift-Right click on contents and “Copy as path”
  3. Paste into target document
  4. “Find and Replace” unwanted path text – Replace with blank.

What scripting language do you think you have available on a phone? (What phone OS is this on?)

@MindsEye_Watering outlined a general method if you install a Google Drive client on your PC, since scripting options are plentiful. But without some specialist tooling, I don’t know of any options to programmatically acquire or manipulate a list of the contents of a Google Drive.

Or alternatively, you can open a cdm window in the Google Drive folder and type in “dir /b . >filenames.txt”. This creates a list of the bare filenames in the text file filenames.txt. Skips the “Find and Replace” step.

It’s Android.

I was concerned that I might need a different cloud drive. Apps can read Google drive. X-explore will open it, list files, and copy/move. He may be using google tools in that App. You still get the same list grouped by folder and another goup of zip files. I deeply regret ever uploading those folders. I should have kept them in the original container.

I’ll look at some other cloud drives and see if they’ll extract file names into a text file.

I also dust off my laptop. Trying doing whst I need in Windows.

That sounds like my best option. I’ll try it this weekend. Thanks

Look for a program called rclone. It is a free and open source command line program that can do lots of manipulations on cloud storage. Once you give it access to your Google drive, it will be able to do things like list all of the files. It isn’t going to solve your problem, but it may be a key ingredient in any script or process that solves it.

Like with all versatile command line tools, rclone has a ton of options, because with great power comes great complexity.

I see now in your quote that discourse ate up a crucial part of the dir command in my first post, so here’s the proper command in a code box:

dir /b *.* >filenames.txt

IIRC there’s a sort option too?

I can always import into a spreadsheet and sort if needed.

As you say, there’s a sort option for the “dir” command, though I don’t remember it and had to look it up. But I think without it, the list is sorted alphabetically, and as you also say, it might be easier anyway to sort it in the order you like in a spreadsheet or database application after export.

I love The Dope. Always get great answers to questions. Thanks

I’m going to take this a step further. Create a song database of my purchased lessons. Setup query screens to list by artist or song. Include any short notes I’ve made about playing the song. I play songs for awhile and move on to others. I eventually get rusty on the old material.

Getting the data is always step 1. I can do that now.

The command to do a directory listing of the entire tree, not just one directory:

add /s to the command. Such as…

DIR C:\USERS\ME\DOCUMENTS /S /B (or whatever folder you want to list) The example givenr by hund will put filenames.txt in the current working directory.

If you want to know all the options, DIR /?

Thanks for the correction. I didn’t remember the /s switch and that the “*.*” part is superfluous. My old DOS skills are very rusty…