Skip to content

Write layout - "As flat as possible option" #35

@frankhommers

Description

@frankhommers

I have read this:

The writer does not currently preserve the layout of the original document! This is to save size and keep things simple for now.

But I have a file with a lot of nested stuff.
For instance:

[date.1]
RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))(\\-|\\/| \\- )(?<Month>(0[1-9]|[1-9]|1[0-2]))(\\-|\\/| \\- )(?<Year>((20|19)\\d\\d))"
Priority = 1

[date.2]
RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))(\\.|\\s|)+(?<MonthText>(jan|feb|maa|apr|mei|jun|jul|aug|sep|okt|nov|dec)).{0,6}(\\.|\\s|)+(?<Year>((20|19)\\d\\d))"
Priority = 2

[date.3]
RegEx = "(?<MonthText>(jan|feb|maa|apr|mei|jun|jul|aug|sep|okt|nov|dec)).{0,6}(\\.|\\s)+(?<Year>((20|19)\\d\\d))"
Priority = 3

[date.4]
RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))\\.(?<Month>(0[1-9]|[1-9]|1[0-2]))\\.(?<Year>((20|19)\\d\\d))"
Priority = 4

[date.5]
RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))(\\-|\\/)(?<Month>(0[1-9]|[1-9]|1[0-2]))(\\-|\\/)(?<YearMod100>(0|1|2)\\d)"
Priority = 5

[date.6]
RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))\\s?(\\-|\\/| \\- )\\s?(?<Month>(0[1-9]|[1-9]|1[0-2]))\\s?(\\-|\\/| \\- )\\s?(?<Year>((20|19)\\d\\d))"
Priority = 6

[date.7]
RegEx = "(?<Year>((20|19)\\d\\d))(\\-|\\/| \\- |\\.)?(?<Month>(0[1-9]|[1-9]|1[0-2]))(\\-|\\/| \\- |\\.)?(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))"
Priority = 1

That will get pretty hard to use after saving:

date = { 1 = { RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))(\\-|\\/| \\- )(?<Month>(0[1-9]|[1-9]|1[0-2]))(\\-|\\/| \\- )(?<Year>((20|19)\\d\\d))", Priority = 1 }, 2 = { RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))(\\.|\\s|)+(?<MonthText>(jan|feb|maa|apr|mei|jun|jul|aug|sep|okt|nov|dec)).{0,6}(\\.|\\s|)+(?<Year>((20|19)\\d\\d))", Priority = 2 }, 3 = { RegEx = "(?<MonthText>(jan|feb|maa|apr|mei|jun|jul|aug|sep|okt|nov|dec)).{0,6}(\\.|\\s)+(?<Year>((20|19)\\d\\d))", Priority = 3 }, 4 = { RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))\\.(?<Month>(0[1-9]|[1-9]|1[0-2]))\\.(?<Year>((20|19)\\d\\d))", Priority = 4 }, 5 = { RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))(\\-|\\/)(?<Month>(0[1-9]|[1-9]|1[0-2]))(\\-|\\/)(?<YearMod100>(0|1|2)\\d)", Priority = 5 }, 6 = { RegEx = "(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))\\s?(\\-|\\/| \\- )\\s?(?<Month>(0[1-9]|[1-9]|1[0-2]))\\s?(\\-|\\/| \\- )\\s?(?<Year>((20|19)\\d\\d))", Priority = 6 }, 7 = { RegEx = "(?<Year>((20|19)\\d\\d))(\\-|\\/| \\- |\\.)?(?<Month>(0[1-9]|[1-9]|1[0-2]))(\\-|\\/| \\- |\\.)?(?<Day>(0[1-9]|[1-9]|[1-2][0-9]|[3][0-1]))", Priority = 1 } }

Would it be possible to introduce a flag during writing which will write the file as flat (or elaborate) as possible.
Meaning generating a [part] wherever possible ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions