Subscribe to this thread
Home - General / All posts - API Documentation of valid properties
KlausDE

6,410 post(s)
#03-Aug-19 10:39

I want to export a txt file in the exact form of a localization file.

I.e. no field header, no quotes limiting text and file extension 'txt'

The TXT datasource in Manifold doesnt allow INSERT without mfd_id identifier. This is not doing exactly what I want although it uses a PropertySet as it works for import. Is there a solution in pure SQL or should I go with VB.NET?

' VB.NET

' Manifold 9.0.169

Class Script

Shared Manifold As Manifold.Context

Shared Sub export_ui_file(tableName as String, path AS String)

    Dim app AS Manifold.Application = Manifold.Application

    Dim db AS Manifold.Database = app.GetDatabaseRoot()

    Dim connProperties = app.CreatePropertySet()

    connProperties.SetProperty("Source", path)

    connProperties.SetProperty("SourceDelimiter""\t")

    connProperties.SetProperty("SourceFieldHeader"false)

    connProperties.SetProperty("SourceQuote""")

    db.Export(tableName , "csv", connProperties.ToJson())

    app.Log(connProperties.ToJson())

End Sub

Shared Sub Main()

 

    export_ui_file("_temp_ui_Tbl""E:\Temp\ui.de.txt")

End Sub

End Class


Do you really want to ruin economy only to save the planet?

adamw


10,447 post(s)
#07-Aug-19 12:52

I am not sure I understand completely, but (a) a script seems fine? it looks simple enough for a frequently performed task you want to automate to as few clicks as possible, no? (b) if the reason you don't want to use MFD_ID for editing is that this is an extra field that screws up the export, you can get editing by creating a BTREE index on the string name ('CommandFileNew', 'CommandFileOpen', etc, those names are both not null and unique by design).

KlausDE

6,410 post(s)
#07-Aug-19 15:25

The original default.ui.txt has no fields but only one line and this line is not unique (dublicate '# name' and empty rows)

I split string names and the rest of the text and the parameters. The later are repeated on and on and need to become translated only once.

I'm now in the state of export in a form that a file compare program like (k)diff exepts as identical. So empty lines and headings matter. I guess I'll move to an ordinary .NET filestream.

(and with the new build I can test if my process survives an update and offers only new strings for translation.)

The Mfd9 import/export aims at comment components. Perhaps there could be a TXT version for the CSV/...-exporter, too, based on tables and a selection of fields to concatenate. My senario isn't all to exotic.


Do you really want to ruin economy only to save the planet?

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.