DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: DONE: export table with template  (Read 15,918 times)

DeVamp

  • Let the coding begin :-)
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 127
    • Furry Fandom Badge - Furry Fandom
DONE: export table with template
« on: March 02, 2012, 10:10 AM »
Hi all,

I'm in search of a little program that can maintain a database of labels and errormessages for multi-languages like this:
(possible with more fields)
LABELCODE1ELABELDESCRIPTION1
LABELCODE2ELABELDESCRIPTION2
LABELCODE1NLABELDESCRIPTION1
LABELCODE2NLABELDESCRIPTION2
MESSAGE1EMESSAGEDESCRIPTION1
MESSAGE2EMESSAGEDESCRIPTION2
MESSAGE1NMESSAGEDESCRIPTION1
MESSAGE2NMESSAGEDESCRIPTION2

And that can filter (i.e. col2 = 'E') and then export the selection to something like this:

Quote
<?xml version="1.0" encoding="utf-8" ?>
<Resource>
 <item name="LABELCODE1">LABELDESCRIPTION1</item>
 <item name="LABELCODE2">LABELDESCRIPTION2</item>
 <item name="MESSAGE1">MESSAGEDESCRIPTION1</item>
 <item name="MESSAGE2">MESSAGEDESCRIPTION2</item>
</Resource>

And so you define a start part:

Quote
<?xml version="1.0" encoding="utf-8" ?>
<Resource>

A detail part:
Quote
<item name="{COLUMN1}">{COLUMN3}</item>

And an end part:
Quote
</Resource>

So its something like the merge function in word, but then in a program where you can save records, a start, a detail and an end part.

I was thinking something like the great "SnapDB" to store the records and perhaps a 2nd program or "plugin" to define the export :-)

If I'm unclear, just ask more details.
Thanks in advance.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: DONE: export table with template
« Reply #1 on: March 02, 2012, 11:51 AM »
Could this fill in your need?
Free but somewhat laborious tool: http://www.poedit.net/
Non-free (but rather cheap) tool: http://www.funduc.com/rtt.htm
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

DeVamp

  • Let the coding begin :-)
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 127
    • Furry Fandom Badge - Furry Fandom
Re: DONE: export table with template
« Reply #2 on: March 02, 2012, 12:46 PM »
Not really I think

Those are programs to control a translation database.
I want something to export a list/excel to a xml file.

I've looked at your "Excel2Html", and that comes very close to what I need, with 1 thing:
I want to be able to choose the columns and layout of the rows in single file mode.
I'll post that in your thread. :-)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: DONE: export table with template
« Reply #3 on: March 02, 2012, 10:09 PM »
Updated Excel2Html here to include new tags to loop over a part of the template in single-file mode. 8)
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: DONE: export table with template
« Reply #4 on: March 03, 2012, 08:51 PM »
I was thinking something like the great "SnapDB" to store the records and perhaps a 2nd program or "plugin" to define the export :-)

I don't want to step on Ath's toes, but I've just implemented a sort of "export to script" functionality in Snap DB that allows you to send the current data view you see in Snap DB to another file (.ahk, .pl, .exe, etc.).  This will allow you to process and format that data however you see fit.  I've made a sample AHK export script that spits out an XML file in the format you specified above.  Would you still be interested?
« Last Edit: March 04, 2012, 12:29 AM by skwire »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: DONE: export table with template
« Reply #5 on: March 03, 2012, 09:25 PM »
@DeVamp: It mostly depends on how you (want to) store your data.

@Skwire: the more the merrier :Thmbsup:
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: DONE: export table with template
« Reply #6 on: March 05, 2012, 12:35 AM »
DeVamp, download the latest Snap DB and install it.  Then grab this file:  DeVamp_XML.zip

Extract the DeVamp_XML.ahk file into the export subfolder in your Snap DB install folder.  If you don't have an export subfolder, simply create one.  Start Snap DB and populate it with data like in your first post.  Filter it however you want and then choose the new menu option: File > Export to... > DeVamp_XML.ahk from the menu.  The export script will then ask you where you want to save the resultant XML file.  Keep in mind that you could edit the export script to automatically dump the XML file to wherever you want.  Also, as I stated previously, you're not limited to AHK export scripts.  You could use Perl, Python or anything that can take a filepath and read in a file.

One other thing.  Since your XML specified UTF-8, that DeVamp_XML.ahk script assumes you're running some version of AHK_L in order to be able to write the file in UTF-8.  If you are not using AHK_L, simply comment out the following line in the script:

FileEncoding, UTF-8

Let me know how it goes.  Thanks.

DeVamp

  • Let the coding begin :-)
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 127
    • Furry Fandom Badge - Furry Fandom
Re: DONE: export table with template
« Reply #7 on: March 05, 2012, 11:50 AM »
Both solutions look very good  :Thmbsup: :Thmbsup:

@skwire: I'll give it a try today or tomorrow. :-)
I guess you export it as a CSV file? The same exprot file as the "export rows to CSV file"?

@Ath: I was thinking of using the export from snapDB as input for Excel2HTML, but the CSV file is not usable as an XLS file.
Too bad.

That would have been super awesome.
Now both are "just" awesome :-)

And as Ath said:  it all depends on how to store the data.

Thanks both for the efforts :-)

DeVamp

  • Let the coding begin :-)
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 127
    • Furry Fandom Badge - Furry Fandom
Re: DONE: export table with template
« Reply #8 on: March 05, 2012, 02:28 PM »
This is solved for me.

Solution:

From Ath : Excel2Html if you start with Excel files

From Skwire : SnapDB witch is a great simple database program.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: DONE: export table with template
« Reply #9 on: March 05, 2012, 02:29 PM »
Great to hear.  Thanks for reporting back.  :)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: DONE: export table with template
« Reply #10 on: March 05, 2012, 03:11 PM »
Glad we could help :up:
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

Original address: https://www.donationcoder.com/forum/index.php?topic=30163.0