DataviewsJS help - Reading a log file

HI there, i am working on a solution to pull certain emails from an Outlook/Exchange into Obsidian, i have the first part in python working, which pulls (.msg) files down into a given contacts folder within my obsidian and creates a log file in the same folder (~maillog). I would like to parse this log file and say pull the last ten log lines in a dataview table.

Folder Structure
Contacts

Contact Name

Email

~maillog (text log file)
Info (Text file will have Yaml for a given contact name,aliases,phone etc)
ContactName_0001.msg
ContactName_0002.msg
etc etc

Example log line ( I replace file name with Subject of Email and Timestamps are Email receipt time)

21-09-2021 17:53 <[email protected]> [[Machine Mart_000018.msg|Grab a Bargain in our Sale!]]

Hating JS i have tried and don’t seem to be getting anywhere.

Here is a snippet from the info file above that i plan to display the entries in a table, but as i said i don’t feel confident at all with JS and probably barking up the wrong tree.

dv.table(['P1', 'P2', 'P3'],
dv.pages("[[maillog]]")
 .map(p => [p.f1, 
 p.f2,
 p.f3 
 ])
 )

I also tinkered with file.lists and dv.io.load bit with example pretty much none existent gave up on them.

My initial plan was to pull the emails down and insert Yaml at the beginning of each file, but with html format and tables etc, these don’t look great as .md files and hence my am now looking at .msg files.

Thanks to anyone who reads and comments with thoughts/ideas

I don’t know if I understand completely…

21-09-2021 17:53 <[email protected]> [[Machine Mart_000018.msg|Grab a Bargain in our Sale!]]

This ^^ is a content example of your log files?
What means f1, f2, f3 in your query?

Dataview works with metadata, not the full content of the pages.
To do that, I guess you need to go via API…

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