Skip to main content

I am a photographer and cinematographer. As such, I have innumerable external drives with images and clips on them. Each drive has a top level file ‘listing.txt’ that has the entire folder structure, down to each filename. This can have tens of thousands of lines. 

I want to create a base that lists all of my drives and has ‘listing.txt’ as an attachment. Easy. 

 

BUT!!!

 

I want to make the base searchable, so if I type in ‘badger’, the base will return the drives that have a file or folder that contains the word badger.

 

Can I make the listing.txt file searchable? Or, do I need to break it up into 100000 character chunks and have numerous long text fields. (I have tried unsuccessfully to do this - but I don’t really know what I am doing!). 

 

Insights welcomed, and thanks in anticipation,

Roy Dunn

From a database perspective what I’d suggest is making a Drives table and a Files table, so each of those filenames has a record in the Files table which is linked to the Drives table. Then you could just filter in the Files table and identify which drive has what. (Honestly the drives table part might be overkill, you could just use single selects to ID the drives unless you have more information about the drives that needs to be maintained).

The issue there is going to be record limits depending on your plan, as each base is limited to 1,000 record for free, 50K for Team and moving up from there. From a Team perspective you could split across a couple of bases at least.

As for bringing the information in, if you can convert the .txt to .csv, maintaining each line as a separate row, then it’d be trivial to simply import those files in as new records.


@hsfpix 

I like ​@DisraeliGears01’s solution above, but as he said, you will likely need to worry about record limits with that approach.

I also like your solution of splitting up each text file into smaller chunks of text, and storing the smaller chunks of text files into long text fields.

I just did a quick search on the web, and it seems like a tool like this might be useful in splitting up text files: https://textfilesplitter.com/

Hope this helps!

If you have a budget and you’d like to hire the best Airtable consultant to help you with anything that is Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


Hey ​@hsfpix unless you also need the database for a different purpose, you can probably get around this by just having an n8n automation (and n8n form) or any other combination (e.g. Fillout form and make.com automation, etc). -more on these different automation tools here.

The form would have just one question for keywords.
The automation would go do your drive account, get specific folders (depending on the logic), get the files, search, and provide you on the form itself (if n8n) or via email, the url of the corresponding files where that keyword was found.

Not sure how long this could take, but it yes a different workaround that you might want to explore!

Mike, Consultant @ Automatic Nation


Thanks to all for the suggestions. I would prefer to keep a database, as there is other info about each drive I would like to keep track of - brand, size, percentage used, etc. 

I thought the splitting of the listing.txt would work, but I used a command line utility on a mac to create a 100000 character split (created several files). When I try to paste the contents of one of these files into a long text field, Airtable just hangs. 

I might try 90000 to see if that works. 

I am a rank beginner at this, and I am also unsure how to set up the table for an arbitrary number of split files. Some listing.txt files might only be a few lines long, some will require splitting into two, some into eight etc. 

I have a lot to learn, as I am definitely not a coder!

 

Thanks again

Roy.


Ha I had to do this too.  I found it easier to just make a new table and create one record per chunk of text instead of needing to manage fields, and you can just rollup on the field even if each cell contains 90k characters, resulting in a massive rollup field that works like the original text file

I’ve set it up here for you to check out with the script inside it that helps you separate the text file into chunks, so you can just duplicate the base to your own workspace and play with it there.  The idea is you’ll just upload the text file and the script will split it out for you into records with the max characters set in this line:

function groupWordsByMaxLength(str, maxLen = 50) {

It splits out by the word as well so that searching works properly

 


This looks like it would be great - thanks so much. I am neck-deep in real-world stuff, so it will be late next week before I can apply some time to it, but thanks a million!

 

Roy.