Tinderbox Forum

Multi-line TSV or other format import from iOS

I’m working on digital notebooks again and aiming to solve iOS import. I’d like to use Drafts to format notes, which can then be synced via Dropbox to the Mac, then imported via a watch folder to Tinderbox.

2 issues have come up in this workflow:

  1. I’d like to import a note with the following:
  • values for several attributes (thus the tab-separated values format instead of plain text)
  • $Text with multiple line breaks

I tried to do this by typing the following in the $Text column:

Blah blah blah \n blah blah blah

However, the \n character just showed up in the note. It didn’t produce a new line.

  1. When the watch folder imports the txt file formatted as tsv, it doesn’t do it the same way that a drag and drop works. In other words, the text file is imported so that all the tab-separated values just show up as $Text in the note. When I drag and drop, the different columns get stored as the correct attributes in the note.

I’m totally flexible on this front for the tooling. If I’m going about this the wrong way, please let me know what’s worked for you. The main workflow I’m trying to achieve is writing notes with multiple attributes on iOS and getting them into Tinderbox easily. If the watch folder business has to be scrapped for manual import via drag and drop, I can live with that but the watch folder would be nice to have.

OK, if I understand correctly you are trying ti use watched folders to do spreadsheet import (of TSV data). If so, that isn’t currently supported. Watched folder create doesn’t import, files but simply makes a note per file. If you want it to import notes that are detected as TSV (or CSV?) then I think that is essentially a feature request. But, am I misunderstanding your requirement?

You’ve got it. Also wondering if it’s possible to import text with lines breaks as well.

Instead of watching the folder, try dragging it into Tinderbox. I believe that will cause Tinderbox to parse each .tsv file in the folder individually.

If you are looking for a feature that would cause Tinderbox to do something like taking action on a .tsv file in watched folder, I think you get to the same end state as dragging the folder of .tsv files into Tinderbox does.

Unless I totally misunderstand the problem, of course, which is probable

TSV uses carriage returns to delimit records, so multiparagraph text is hard. I think the right way to do this is to enclose the text in quotation marks “like this”. If there are quotation marks in the text, they’d need to be escaped ".

However, I may be confounding TSV and CSV; each has a different approach, and in one of them the commonly-used approach is not in fact in the standard. And I don’t recall what Tinderbox does about escaped quotes in TSV import, so there may be a feature request at the end of this tunnel.

But this is the sort of request we can handle pretty quickly, as a rule.

Ok, I hacked together a solution for this. In my TSV file, I just encode line breaks in the text with “\n”. Then, in the Tinderbox container where I drag the TSV file in, I added this to the $OnAdd:

$OnAdd= '$Text = $Text.replace("\\n","\n")'

Basically, this says: add this “OnAdd” to the child notes (basically, each TSV file becomes a new container filled with one note per line in the TSV file). Then, for each child note, replace the characters \n with an actual line break. Presto!

1 Like