GitMurf / csv-to-roam-table-md

Prepare/convert your CSV tables to be ready to import into your Roam Research database.
MIT License
8 stars 1 forks source link

Ability for certain columns to have their values wrapped in Double Brackets #22

Open GitMurf opened 4 years ago

GitMurf commented 4 years ago

Idea by @classicrob

Okay so this points something out- for each of the attributes except Notes and Description, I’d like to have the output of the attribute be wrapped in double brackets. For notes and description, that doesn’t make sense, whereas everything else does for filtering and queries. So for Related Skills: [[Branching Paths Through Indentation]],[[Provide a summary of their answers]],[[Group multiple elements on a page]],[[Ask a multiple choice question]],[[Format text]],[[Insert multimedia]]

GitMurf commented 4 years ago

For the other request about double bracketing the attribute items like the related skills, how do you suggest the tool does that? If some fields you don’t want bracketed and others you do? The only way I can think of right now is needing to put a flag in your CSV. Also would need to know what the “separator” is for each of the skills you want double bracketed.

The only way I can think of is you have to add a flag at beginning of column headers like maybe an asterisk like “*Related Skills” and then I could add to the tool if it sees asterisk in first character of header then add brackets to the values in that column.

But then have problem with the separator for the skills listed in each field. Especially if it is separated by “commas” like your example, that will mess up the format of the CSV unless they are escaped in double quotes to tell us the commas within that string are part of that field and NOT meant to be CSV comma separators for the columns.

Is this your example/request/use case you mentioned about multi attribute/option table columns from Airtable? If so can you please take an export from Airtable so I can see the exact format it is in? Thanks

GitMurf commented 4 years ago

@phhq responded and said:

Wrapping some attribute values is useful (or even #, or #[[]] for that matter) however -- given that any preference for any #,#[[]] or [[]] wrapper is more domain/data/user-specific, I wonder if performing that kind of operation on the csv itself prior to the Roam import is best. With TEXTJOIN, and the vastly better search/replace functions of Excel or sheets, it may actually be easier. EG - in my CSV, I actually joined to previously separate columns into one, as I thought about what I wanted the page name to be .... could similarly prepare the CSV by formatting common attribute values that are themselves pages before going into the CSV converter for Roam.

GitMurf commented 4 years ago

yep I agree. Manipulating a CSV at the source is much easier than trying to build a million different scenarios/logic into the conversion script. BUT for this use case I can do it if it’s important I just need some requirements like above where maybe a Asterisk is added to header. Actually I don’t like that cuz sometimes you could have that randomly I could see without wanting this outcome. So I’d probably do like tilde ‘~’ which is less common. Then I could do it.