Website Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • August 30, 2015, 09:37:56 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: export table with template  (Read 4263 times)

DeVamp

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 106
  • Let the coding begin :-)
    • View Profile
    • Donate to Member
DONE: export table with template
« on: March 02, 2012, 04:10:32 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: 2,532
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #1 on: March 02, 2012, 05:51:08 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

DeVamp

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 106
  • Let the coding begin :-)
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #2 on: March 02, 2012, 06:46:03 AM »
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: 2,532
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #3 on: March 02, 2012, 04:09:39 PM »
Updated Excel2Html here to include new tags to loop over a part of the template in single-file mode. 8)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,391
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #4 on: March 03, 2012, 02:51:33 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 03, 2012, 06:29:16 PM by skwire »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #5 on: March 03, 2012, 03:25:52 PM »
@DeVamp: It mostly depends on how you (want to) store your data.

@Skwire: the more the merrier :Thmbsup:

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,391
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #6 on: March 04, 2012, 06:35:52 PM »
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

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 106
  • Let the coding begin :-)
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #7 on: March 05, 2012, 05:50:56 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

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 106
  • Let the coding begin :-)
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #8 on: March 05, 2012, 08:28:23 AM »
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

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,391
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #9 on: March 05, 2012, 08:29:09 AM »
Great to hear.  Thanks for reporting back.   :)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: DONE: export table with template
« Reply #10 on: March 05, 2012, 09:11:20 AM »
Glad we could help :up: