Skip to content

Language Archiving Technology

Sections
Personal tools
You are here: Home » Tools » Elan » ELAN Forum » trouble importing csv/txt files (Import window does not appear)

trouble importing csv/txt files (Import window does not appear)

Up one level

trouble importing csv/txt files (Import window does not appear)

Posted by ryanc at 2010-09-22 22:19  
The import csv/txt instructions at
http://www.lat-mpi.eu/tools/elan/manual/ch04s02s21.html
seem clear enough, but I am unable to get the second dialog window (Import) to appear after choosing a comma- or tab-delimited files containing data generated in Excel. Are there any formatting requirements for this? The instructions indicate there are not, but a simple text file containing the letter "a" does not have this problem.
I'm using ELAN v3.9.0 and Excel 2003 on Windows 7 Ultimate x64

Re: trouble importing csv/txt files (Import window does not appear)

Posted by ryanc at 2010-09-22 22:48  
OK, while writing this I tracked down the bug: ELAN chokes on the file if there is missing data. For example, a 5 column csv file containing the data below does not import in ELAN:
a,b,c,d,e
1,2,3,4,
1,2,,4,5
1,2,3,4,,
unless a character of some kind is added to one (just one) of the rows. Perhaps it gets confused by the header row or is treating consecutive delimiters as one or something, but if you force it to be 5x5 with dummy characters (even spaces are ok) then it works.

Re: trouble importing csv/txt files (Import window does not appear)

Posted by ryanc at 2010-09-23 10:03  
Anyway, the work-around I found for importing my time-aligned interview transcript was:

  1. fill in any blank cells in the Excel file with a character (I used dashes instead of spaces so I could see them),
  2. save the file as a tab-delimited text file (note: csv files don't work well for importing transcripts since they may contain commas in the text, which prevent ELAN from parsing the file correctly due to the above-mentioned problem),
  3. import the tab-delimited text file into ELAN per the manual (hey the 2nd approach, which automatically sorts the annotations into separate tiers based on column sure is handy - kudos to the developer!),
  4. go through and delete all the superfluous annotations containing a dash (to speed this up a little, use alt + left-click to select multiple annotations, then right-click and choose "Delete Selected Annotations").

Now that I've gone through all that, will someone tell me there's an easier way to import a transcript?



Re: Re: trouble importing csv/txt files (Import window does not appear)

Posted by eric at 2010-09-28 12:43  

Hi, in theory it should not be a problem to have "," in the content and still use comma separated text. See this example with three columns and five rows:

a,b,c
1,,3
"Hello world", "One, two, three","You can say ""Yes"" to CSV"
one,two,
left,middle,"right"

Note how separators are allowed inside quoted strings and how quotes are escaped by doubling them. This is the standard way to escape things in CSV. Of course tab, comma and semicolon should all be allowed as separators, but the user needs a chance to say which separator is used, in case a possible autodetection fails.

Re: Re: trouble importing csv/txt files (Import window does not appear)

Posted by hasloe at 2010-09-29 09:55  

It appears that there is indeed a bug in the first part of the import, where the delimiter and the number of columns are detected and a window is created showing a sample of the file. The function that is used to detect the number of columns uses deprecated methods that fail when there are empty cells.
This will be fixed in the next release. Until then you can stick to the workaround that you describe, be it that you only have to make sure that the first 10 rows don't contain empty cells.

-Han

 

Powered by Plone

This site conforms to the following standards: