Export to xls, xlsx

818 views
Skip to first unread message

Ken Keyes

unread,
Mar 1, 2012, 11:28:28 AM3/1/12
to flex...@googlegroups.com

Dear All, I know that the FLEx development team is working full-bore to improve FLEx...
They get quite a few feature requests...
Here's mine: enable export of the view from dictionary browse to CSV, tab delimited or xls, xlsx.
My current work-around for this is print from browse view as PDF, then import the PDF into Finereader then export from Finereader as xls.
Why all this trouble?
My colleague is keen to import my SIL CAWL wordlist for Azerbaijani (yes, Azerbaijani) into anki, a vocabulary management program. He can sync anki between his PC & his Android phone. Since anki is based on xml, why not write an XLST transform from LIFT to anki for Pathway? That way we could have the pictures & sound from LIFT in anki. What think ye? Ken

Emmanuel HABUMUREMYI

unread,
Mar 1, 2012, 12:01:04 PM3/1/12
to flex...@googlegroups.com
Hello,
 
Ken's request is mine too. Not only to export but also toimport CSV into FLEX. It is still hard to deel with big database. I hope that one day, I will be able to work on my data in a flexible way. In the meantime, export to .xls, .csv or import these format into FLEX can be a short term solution.
 
Regards,
 
Emmanuel Habumuremyi

De : Ken Keyes <grizzly...@gmail.com>
À : "flex...@googlegroups.com" <flex...@googlegroups.com>
Envoyé le : Jeudi 1 mars 2012 18h28
Objet : [FLEx] Export to xls, xlsx

--
You received this message because you are subscribed to the discussion group "FLEx list". This group is hosted by Google Groups and is open for anyone to browse.
To post to this group, send email to flex...@googlegroups.com
To unsubscribe from this group, send email to flex-list+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/flex-list


Beth (work) Bryson

unread,
Mar 1, 2012, 8:43:05 PM3/1/12
to flex...@googlegroups.com
On Mar 2, 2012, at 12:01 AM, Emmanuel HABUMUREMYI wrote:

Ken's request is mine too. Not only to export but also toimport CSV into FLEX. It is still hard to deel with big database. 

One reason importing from .csv is difficult is the hierarchical nature of lexical data.  Many words can have multiple senses, and once you have multiple senses, you now have something that is not easy to interpret from a .csv file.

If your data does not have that kind of structure, then it should be quite easy to use SheetSwiper to create an SFM file from it that would be quite easy to import into FLEx.

-Beth

Griz

unread,
Mar 2, 2012, 2:53:54 AM3/2/12
to flex...@googlegroups.com, Beth (work) Bryson, Greg Trihus
Folks, I would like to re-frame my request. My request would be:

Make a LIFT to ANKI XLST transform. Is that something that the Pathway guys could handle?

Why? Because in my work around, we lose all the links to picture and sound files.  That's what makes these computer flashcards so valuable.

Thanks for considering this request.

Ken

Emmanuel HABUMUREMYI

unread,
Mar 2, 2012, 4:15:21 AM3/2/12
to flex...@googlegroups.com
That's right Beth. The complex hierarchy cannot facilitate the task in importing .xls or CSV data. However, a request to export Flex data in a table format is not new. If I remember well, the only efficient way suggested on this list and which I tried was to go to the Bulk Edit pane and then Bulk copy where one can select all data he/she wants, then copy and paste in Excel sheet and finally save as a CSV file. This really work well for a small database. But with current version of Flex, whenever I trie to follow this process for 50,000 entries, I always get an error after a very long time (about an hour) of processing them. I am using a HP TouchSmart machine, 3GB of RAM, WIndows 7 Home Premium.
 
Regards,
 
Emmanuel Habumuremyi
De : Beth (work) Bryson <Beth-wor...@sil.org>
À : flex...@googlegroups.com
Envoyé le : Vendredi 2 mars 2012 3h43
Objet : Re: import from .csv (was Re : [FLEx] Export to xls, xlsx)

Richard Gravina

unread,
Mar 2, 2012, 4:08:10 AM3/2/12
to flex...@googlegroups.com
One way of exporting to Excel is to set up the data in Browse view, then Select All, Copy and Paste into Excel. This only works well if the data you want is ‘flat’, without complications such as multiple senses, multiple example sentences etc.
 
Richard

Ken Keyes

unread,
Mar 2, 2012, 11:06:21 PM3/2/12
to flex...@googlegroups.com

Richard, This was perfect. I selected "all" (cntrl a), waited a few seconds, then copied (cntrl c), & pasted into Open Office Calc. Then I selected Unicode. Then I "saved as" csv, with UTF-8 encoding. Finally, I imported into anki.

Griz

unread,
Mar 2, 2012, 11:14:36 PM3/2/12
to flex...@googlegroups.com
The only problem with this is that, of course, none of the media files are included in the new "deck".

Here's an interesting thread that explains how to import a "supermemo" xml into anki.

http://groups.google.com/group/ankisrs/browse_thread/thread/8ad3a74786dde755

Ken

GregT

unread,
Mar 4, 2012, 3:15:49 AM3/4/12
to FLEx list
Do you really want ALL the LIFT fields in the ANKI import file format?
How do you propose to handle the embedding of the LIFT file? Can you
send us a sample of the LIFT file you want converted?

Greg Trihus

unread,
Mar 4, 2012, 5:19:44 PM3/4/12
to Griz, flex...@googlegroups.com, Beth (work) Bryson

Ken

 

I would start by creating a "Publication" in Flex that included just the fields you wanted in the ANKI card. Then you can use the XHTML export to export these fields (form, gloss or definition, sound file and picture). Sound files are handled as a writing system in the latest version of flex so you can actually attach sound files to any field. Then it should be fairly easy to convert the xhtml file using xslt to the ANKI import format. You will probably end up having a separate line on the import for each sense of each form.

 

Greg Trihus

Griz

unread,
Mar 5, 2012, 3:07:57 AM3/5/12
to Greg Trihus, flex...@googlegroups.com, Beth (work) Bryson
Greg,

Thank you for responding! I think probably, the title of my e-mail was misleading. At first, I thought that anki was XML, but it is not.  It is more like HTML.

The following FAQ provides the syntax and tags for anki:

http://ankisrs.net/docs/FileImport.html
http://ankisrs.net/docs/FileImport.html#_importing_media

From what I've seen, most people are using python scripts to transform XML to anki HTML.

Thanks, and Blessings,

Ken

Greg Trihus

unread,
Mar 5, 2012, 5:46:20 AM3/5/12
to Griz, flex...@googlegroups.com, Beth (work) Bryson

Yes, it should be fairly straightforward as a Python script… Is it true that all you want is basically for form, and the gloss? I think the full content of most

LIFT files would overwhelm ANKI. It looks pretty simplistic.

Griz

unread,
Mar 5, 2012, 7:29:29 AM3/5/12
to Greg Trihus, flex...@googlegroups.com, Beth (work) Bryson
Greg,

What I would like is:

Lexeme/Headword
Gloss/Definition
Tags: Semantic Domain or other, e.g., Grammatical POS or a combination of fields, separated by a semicolon.
Graphics file
Sound file

A python to html script would result in an importable file. According to Jon Coombs, anki stores it's info as a SQL file.

Thanks again,

Ken

Jon C

unread,
Mar 18, 2012, 12:18:15 PM3/18/12
to FLEx list
Hi all,

Sorry for the delayed response. It sounds to me like most of what Ken
wants might be covered by a future solution some of us discussed in
some brainstorm sessions at the recent conference in Thailand.

Anki has good support for custom "models", so any number of custom
fields should be doable in theory, but these models are non-
hierarchical and probably don't support repeating fields either.

Anyway, I'm hoping to build a simple prototype in Python that would
pull data into Anki from a LIFT file, including any relevant guids so
that one-way sync could hopefully update specific flashcard data later
on. (Collaboration from other programmers would be welcome.) So, the
user would either use WeSay or periodically export from FLEx to a LIFT
file (probably filtering down to a subset of entries prior to export),
and then run the one-way sync operation, which would pull in just the
relevant data, squashing it flat in the process (e.g. it would
probably concatenate the glosses from all senses into a single
"Glosses" field).

Ken, does this sound roughly like what you're wanting? I'm glad you
listed out the fields you need, because for practical reasons we'll
probably want some constraints as to what all can be imported into
Anki from LIFT. Otherwise, we wouldn't be able to provide very
meaningful pre-baked flashcard templates for the data. What you've
listed looks reasonable to me, although I'm not sure yet how feasible
the tags idea will be. (That is, your suggestion that fields such as
SemDom or GrammaticalCategory could be mapped into Anki's Tags field
is intriguing. But a few possible issues come to my mind, esp. if
doing a sync/update.)

Do any of you think we would ever need one-flashcard-per-sense, rather
than the one-flashcard-per-entry I described above? I'm hoping the
answer is No, especially since it would lead to ambiguous cards. (E.g.
"When I see or hear 'bank', which sense of 'bank' is it asking me
for?") But I do suspect it would be helpful in some future version to
support one-flashcard-per-example-sentence, probably using a second
custom model in Anki, essentially creating a second parallel set of
records within the same Anki deck. I wonder how useful this feature
would be... without it we'd be limited to only including one example
sentence bundle per entry (the first one, presumably). Maybe that's
enough?

Anyway, this is still early days. Maybe the Anki developer will give
us some input as well. I'm hoping to contact him now that we know more
about what we want.

BTW, regarding Anki's file format for storing the flashcard data, it
seems to be a SQLite database, from what I've read. So it's not XML,
and certainly not HTML (although the flashcard templates which display
the data are indeed designed using HTML). So, Python seems more
promising than XSLT in that regard, especially since Anki is written
in Python and supports plugins, though I need to learn more about what
those plugins can and can't do.

Jon

On Mar 5, 8:29 pm, Griz <grizzly.ken...@gmail.com> wrote:
> Greg,
>
> What I would like is:
>
> Lexeme/Headword
> Gloss/Definition
> Tags: Semantic Domain or other, e.g., Grammatical POS or a combination
> of fields, separated by a semicolon.
> Graphics file
> Sound file
>
> A python to html script would result in an importable file. According to
> Jon Coombs, anki stores it's info as a SQL file.
>
> Thanks again,
>
> Ken
>
> On 3/5/2012 2:46 PM, Greg Trihus wrote:
>
>
>
>
>
>
>
>
>
> > Yes, it should be fairly straightforward as a Python script... Is it
> > true that all you want is basically for form, and the gloss? I think
> > the full content of most
>
> > LIFT files would overwhelm ANKI. It looks pretty simplistic.
>
> > Greg Trihus
>
> > *From:*Griz [mailto:grizzly.ken...@gmail.com]
> > *Sent:* Monday, March 05, 2012 3:08 PM
> > *To:* Greg Trihus
> > *Cc:* flex...@googlegroups.com; Beth (work) Bryson
> > *Subject:* LIFT > anki HTML was LIFT>anki XLST transform...was( import
> > from .csv (was Re : [FLEx] Export to xls, xlsx))
>
> > Greg,
>
> > Thank you for responding! I think probably, the title of my e-mail was
> > misleading. At first, I thought that anki was XML, but it is not.  It
> > is more like HTML.
>
> > The following FAQ provides the syntax and tags for anki:
>
> >http://ankisrs.net/docs/FileImport.html
> >http://ankisrs.net/docs/FileImport.html#_importing_media
>
> > From what I've seen, most people are using python scripts to transform
> > XML to anki HTML.
>
> > Thanks, and Blessings,
>
> > Ken
>
> > On 3/5/2012 2:19 AM, Greg Trihus wrote:
>
> > Ken
>
> > I would start by creating a "Publication" in Flex that included just
> > the fields you wanted in the ANKI card. Then you can use the XHTML
> > export to export these fields (form, gloss or definition, sound file
> > and picture). Sound files are handled as a writing system in the
> > latest version of flex so you can actually attach sound files to any
> > field. Then it should be fairly easy to convert the xhtml file using
> > xslt to the ANKI import format. You will probably end up having a
> > separate line on the import for each sense of each form.
>
> > Greg Trihus
>
> > *From:*Griz [mailto:grizzly.ken...@gmail.com]
> > *Sent:* Friday, March 02, 2012 2:54 PM
> > *To:* flex...@googlegroups.com <mailto:flex...@googlegroups.com>
> > *Cc:* Beth (work) Bryson; Greg Trihus
> > *Subject:* LIFT>anki XLST transform...was( import from .csv (was Re :
> > <mailto:flex...@googlegroups.com>
> > To unsubscribe from this group, send email to
> > flex-list+...@googlegroups.com
> > <mailto:flex-list+...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages