Import From Excel: New Note for Each Row

Things I have tried

I’ve searched here and in the Discord chat and on google for info on this, but can’t find anything, so hopefully this is the place to look next :slight_smile:

What I’m trying to do

I am not trying to recreate an excel table in Obsidian, or to link to an excel file.

I have a huge database of expeditions, and each expedition has info in columns for the date, location, category, contact info etc

What I would like is to be able to import this data into Obsidian so that each ROW in this excel file becomes a NOTE in Obsidian, and ideally automate this so that tags and/or links are created, so that, eg: each expedition that went to Cambodia is tagged with #Cambodia OR Cambodia is linked to a Cambodia page.

Is this possible? I have about 10,000 Notes to enter by manually otherwise!

1 Like

Are you familiar with any programming languages? Because this is something you could script. (I don’t know if any existing tool or process exists. It might.)

For example, in Python you have modules to work with CSV (you could export to CSV, and then parse it with those tools and write them to .md text files). Or there are Python modules xlrd and xlwt which can read and write elements of a spreadsheet.

1 Like

No, but perhaps this is the excuse to learn python.

Others in the discord chat are suggesting exporting to tab separated file and then using notepad++ to find a replace in order to create headings and tags, and then using refractor plugin to split it all out into notes

1 Like

That sounds like a decent idea too.

I see some other notes here, but it might require another tool: How to export/save each row as text file in Excel?

1 Like

I have a simple script that works. (needs some polishing though)

1 Like

Another idea is to import into Notion, then export from there (include the subpages).

If you don’t mind the note files not actually being created, but rather simply linked to, this technique may be of some use: Auto-create new notes by linking to them - #43 by I-d-as

You could also support the feature request that reply was in response to that suggested a function to auto create links. Short of that, I have had some success using an AHK macro with a loop to traverse the list of links with down right and left arrows (moving cursor within brackets on each line, however there are some catches to be aware of), hitting alt enter, then finally navigate back hotkey, and repeat. It is helpful to add some sleep time depending on size of vault.

I actually also created an AHK macro for triggering the find and replace and entering all the symbols and using a sequence of tabs and enters to automate things. It is pretty fun to try, but be careful.

I am sure there is a much better way. I would definitely be interested in the script @koala created, although I am using Windows.

Thanks.

Phew, 10k files. Sounds like the perfect excuse to export the Excel data to CSV, hack up a quick’n’dirty bash/Python/Perl/… script, and let it create a zillion notes within a separate folder in your vault …

I’d probably go for Python, since it is—or can be—installed almost everywhere and has good libs for CSV handling.

If you’re on Windows, just don’t forget to export or convert the CSV into the UTF-8 character set. (I do assume Obsidian uses UTF-8 on Windows internally?)

Just to give an update here as well, I wrote a script for @soulchaser, so I consider this resolved.

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.