ObsidianSimpleTimeTracker icon indicating copy to clipboard operation
ObsidianSimpleTimeTracker copied to clipboard

Table Export as Indents

Open algoldst opened this issue 1 year ago • 1 comments

Hi, great extension you've created! I'm trying to get export to work where it automatically creates additional columns for sub-tasks:

image

Basically, I think that the "part 1" and "part 2", as sub-tasks underneath "thing 4", should have their own empty csv column, and start being listed in the second column. You'd have to have a variable number of columns before the "start" and "end" time columns, in order to represent sub-task levels in this way. But I think it would be better / more intuitive.

Also, I tried coding up a solution that would simply detect the blank spaces in the timestamps, to auto-indent the stuff below. But in fact, it's not possible to do this, because there's no way to recognize when we've hit the last item in a sub-hierarchy! Eg. After Part 1, the task "Thing 5" is not recognizable as its own top-level task. This means no program analyzing it (or really, any person who didn't know about the tasks) would be able to recognize where a sub-task list ends and a new top-level task begins, as far as I can tell.

algoldst avatar Apr 20 '24 01:04 algoldst

Hi @algoldst, in a CSV file, it's not possible to represent indentations by using new cells or to maintain a visual hierarchy like in Excel. CSV is a plain text format that only stores the raw data of each cell without any layout or formatting information (such as merged or indented cells).

Explanation

  • The example provided is created using Excel, where cells are manually indented or visually structured to represent a hierarchy. This is an Excel feature and is not preserved in a CSV file.
  • When exporting the Excel table to CSV format, all formatting, indentations, and merged cells are lost. The CSV file only stores the raw text content of each cell, and the hierarchy information is not retained.

Alternative Representation in CSV

To indicate sub-tasks in CSV, you can use prefixes like "-" to visually represent the hierarchy. This approach provides a textual indication of the hierarchy without relying on cell formatting.

Issue References

  • This method of representation is already discussed in ** Issue #22**.
  • A feature / pull request (#67) implementing this behavior is currently under review.

This pull request will format the sub-entries as following: Pasted image 20241117164828

@Ellpeck this issue may be closed due to a duplicate of issue #22.

Karamellwuerfel avatar Nov 17 '24 16:11 Karamellwuerfel

Closed by #67

Ellpeck avatar May 27 '25 10:05 Ellpeck