Import Excel/CSV files and have each row become a Page

I have a spreadsheet with several thousand rows and five columns. I’d like each row to become a page in Logseq, and the column data become properties for the page. Is this possible?

Welcome. This is possible only with scripting, outside Logseq. You need a script that will read the spreadsheet, split it per row and parse each column, then produce one markdown file for each row. However, thousand small files is not a good idea. Are you aware that you can apply properties to blocks as well? How do you plan to use the produced graph afterwards?

Thanks. I’m less concerned about the graph than the interlinking of the information. Is there a format I can use to copy and paste it so that the pages get created? I.e., would it work if I prefixed the page names in Excel with [[]] ?

  • By graph I mean exactly the interlinking of the information.
    • This is not the Graph view, but the data itself.
  • There is no format that auto-creates pages.
    • Markdown format could at best auto-create blocks within a page.

Thanks. If those blocks you mentioned include the [[ ]] brackets will it turn them into page links?

If you export in markdown format (i.e. text with special marks):

  • any text inside double brackets (e.g. [[pagename]] ) will be interpreted as page references (i.e. links) to same-named Logseq pages
  • single words can also be interpreted as links, if prefixed with # (e.g. #pagename )
    • These are called tags, but in Logseq they are equivalent to page references.

Thanks. I was able to get it to work by saving it to a .txt file and ensuring the data was in the proper format. Here is the ChatGPT prompt to repeat the process. Replace the column titles with your own column names:

I have an Excel file with columns titled “Title”, “URL”, and “GUID”. I want to convert each row in this file into a separate page in Logseq, with the title as the page name and the URL and GUID as properties. Please provide a Python script that reads the Excel file, formats the data appropriately, and outputs it to a text file where each entry is on a new line and follows Logseq’s markdown format. Ensure the title is enclosed in double square brackets [], and the properties are prefixed with "url:: " and "guid:: ". Provide detailed instructions on how to use the script.

1 Like