Consistent number of digits in csv export

I’ve been using the CSV export lately to keep my data in a seperate file. Unfortunatly any numbers used (like for Internal IDs, or years) use just the digits they need.

So you have like Character1, Character 2, …, Character11

But if I organize that by alphabetical order in a csv file, it order them like this:

Character1
Character11
Character2

Same things for dates- the year 570 is after 1870 because 5 is after 1. Or ‘Chronological Order.’

I believe the only solitions to this are either to have the numbers saved as numbers, not text, but that would only work for things like the year- without any words.

I would like for there to be an option in the Export to CSV function to add ‘leading 0s’ and essentially add the needed digits, depending on the highest number used.

So you would instead have

Character01
Character02
etc.

If you get into the 100s, make it “Character001” instead.

(If this is something that can be worked around outside of Aeon, please let me know, just in case this isn’t or can’t be implemented).

Basically, IDs are like license plates, i.e. they are no good for sorting, especially as you have no influence on the assignment when working with AT.
I would open csv files with a spreadsheet program and sort the lines by the correct names. A spreadsheet should also be able to convert dates into a sortable internal timestamp if you format the corresponding column as dates.

1 Like

You’re encountering lexicographical order instead of natural order. Lexicographical order treats everything as strings (text), so it compares characters one by one from left to right, rather than interpreting numbers or dates as numerical values.

What tool are you using to sort the data?

2 Likes

This definitely applies to the dates, but a spreadsheet can convert the strings internally.

As far as the IDs are concerned, they are good for keeping the item types apart, but the numbers attached to them can be regarded like random numbers.

2 Likes

Thanks all! I was using a new plugin in Obsidian, and actually found a work-around for the dates. Thanks for explaining!

1 Like

I use Obsidian extensively. I’d enjoy learning more about the problem and its solution, including the plugin, if you have time, of course. :slight_smile:

No problem, Steve! I have been trying to get Obsidian to show my Aeon data for a while now, tweaking various attempts as I found flaws. ‘Syncing’ isn’t really working out, but I’ve been working on a set up where all I need is to export the CSV and throw it in my vault, while queries in the main pages show me the data I need for various items.

I’ve been using Dataview, and waiting for Datacore, but I found a new plugin that might work just as well:

https://hypersphere.blog/sql-seal/

It’s new, but updated frequently, and I’m hoping it’ll fill the niche I need. (I might try Datacore when that comes out, but I haven’t been able to find any info on whether Datacore will even allow querying a csv.)

Like I said, numbers weren’t being sorted right because of how they’re stored. But, at least when using a SQL query to show data, I found I can add this to the query, and it will actually have it right:

ORDER BY ABS(start_date), start_date

So while it doesn’t help in the CSV itself, it should help in all the other places I need it.

Now I’ve never used SQL before, so I’m winging it and learning as I go. Hope it helps :slight_smile:

1 Like

This is really cool.

I wasn’t aware of the SQLSeal plugin, so thanks for mentioning it. In reading about it, I see that it can query directly from a .csv file which (correct me if I’m wrong) Dataview can’t.

I can see some interesting opportunities in better coordinating between AT and Obsidian.