Is There A Quick And/or Easy Way For Me To Fill In Data In A Csv File Based On Other Data Already There?

My csv file is an export from a program I am using. With another code I found online, plus help from the python discord about changing up some details, I can now turn it into a bunch of md files with YAML frontmatter for Obsidian. So far so good…

The program is Aeon Timeline, and it allows you to create intricate detailed timelines of either real or fictional worlds, with sections for things like Person, Location, Event, etc.

It gives you a nice info panel on the right that can display all of this and how many of the things relate to each other. The best part is you can denote a relationship between items as either Bi-directional or Inverse and it will update both items at the same time if you modify either.

So let’s say my designated relationship is called Siblings. I mark down that Casey has Denise and Eugene in their Siblings relationship. If I then go to Denise’s panel, it will already have Casey and Eugene linked as Siblings. Ditto Eugene’s panel.

I can also make a relationship work inversely. If I put in the relationship Parents/Children, I can add Amy and Ben as Casey’s Parents. In doing so, in Amy’s panel, it will have Casey under Children. I do have to do this for every ‘sibling’ and add the parents manually, as they don’t connect outside of the two-way direction, but that’s alright.

I can also mark down Amy as Ben’s Spouse so Ben is also Amy’s Spouse.

I had assumed when I exported a CSV of all of this data that it would give me all of said relationships in both directions, as that is what the program does. That is part of the reason why I use it, so I don’t have to go back and re-add things so they’re ‘linked’ from both sides. But I annoyingly realized it only gives half.

So instead of this:

Label Parents Children Siblings Spouse Amy – Casey,Denise,Eugene – Ben Ben – Casey,Denise,Eugene – Amy Casey Amy,Ben – Denise,Eugene – Denise Amy,Ben – Casey,Eugene – Eugene Amy,Ben – Casey,Denise –

I get this:

Label Parents Siblings Spouse Amy – – Nothing Ben – – Amy Casey Amy,Ben Denise,Eugene – Denise Amy,Ben Nothing – Eugene Amy,Ben Nothing

‘Children’ doesn’t even show up in the export as a column at all, just ‘Parents.’ For relationships where it was bi-directional and one word, it only gives me the first half- the one I typed in. So Amy is Ben’s Spouse, but Amy isn’t Ben’s.

Making the meta-data in the YAML worthless as I have to go through and re-fill it out again from the other side of things anyway.

I therefore need a script, program, or way that I could fill in these missing data points. Ideally I would love to be able to:

1) Define which relationships need new columns, and which can be filled in in an existing column (because I have many varying people/events/locations with different relationships and how they relate go each other):

same_relationship = (‘Extended Family’, ‘Romances’, ‘Siblings’)

opposite_relationship = (‘Parents’, ‘Birthplace’)

2) And then be able to write in something like

if {a Label} is in Column/Header “same_relationship” for certain Rows, add {the Label of this new Row} into the same column for {original Label}.

if Denise is in Column/Header “Siblings” for certain Rows (the rows where the labels are Casey and Eugene), add ‘Casey’ and ‘Eugene’ into “Siblings” for Denise.

if {Label} is in Column/Header “opposite_relationship” for certain Rows, add {the Label of this new Row} into new column ‘opposite_relationship Opposite’ for {original Label}.

if Amy is in Column/Header “Parents” for certain Rows (the rows where the labels are Casey, Denise, and Eugene), add ‘Casey,Denise,Eugene’ into new column ‘Parents Opposite’ for Amy.

Then I could manually change ‘Parents Opposite’ into ‘Children’ along with all of the other new columns I need to change.

I feel like there has to be an easy-ish way to somehow do this with something, I just have no idea how. Or where to start. I just want to be able to fill in my data and continue with my worldbuilding.

submitted by /u/Faustyna
[link] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *