Welcome Guest.   Make a donation to an author on the site December 22, 2014, 05:27:59 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2010! Download 24 custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: export table with template  (Read 3800 times)
DeVamp
Supporting Member
**
Posts: 103



Let the coding begin :-)

see users location on a map View Profile Give some DonationCredits to this forum member
« 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.
Logged
Ath
Supporting Member
**
Posts: 2,304



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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
Logged

DeVamp
Supporting Member
**
Posts: 103



Let the coding begin :-)

see users location on a map View Profile Give some DonationCredits to this forum member
« 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. :-)
Logged
Ath
Supporting Member
**
Posts: 2,304



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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. Cool
Logged

skwire
Global Moderator
*****
Posts: 4,186



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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 » Logged

Ath
Supporting Member
**
Posts: 2,304



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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
Logged

skwire
Global Moderator
*****
Posts: 4,186



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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.

Logged

DeVamp
Supporting Member
**
Posts: 103



Let the coding begin :-)

see users location on a map View Profile Give some DonationCredits to this forum member
« 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 :-)
Logged
DeVamp
Supporting Member
**
Posts: 103



Let the coding begin :-)

see users location on a map View Profile Give some DonationCredits to this forum member
« 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.
Logged
skwire
Global Moderator
*****
Posts: 4,186



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #9 on: March 05, 2012, 08:29:09 AM »

Great to hear.  Thanks for reporting back.   smiley
Logged

Ath
Supporting Member
**
Posts: 2,304



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #10 on: March 05, 2012, 09:11:20 AM »

Glad we could help thumbs up
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.037s | Server load: 0.07 ]