Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Export entries to XLS or CSV?, posted by scogordo on Wed May 15 17:24:12 2013 
    icon2.gif   Re: Export entries to XLS or CSV?, posted by Andreas Luedeke on Wed May 15 23:31:30 2013 elog-find.png
       icon2.gif   Re: Export entries to XLS or CSV?, posted by Jim Tinlin on Thu May 30 22:52:51 2013 
          icon2.gif   Re: Export entries to XLS or CSV?, posted by Andreas Luedeke on Fri May 31 11:41:48 2013 diff.txt
             icon2.gif   Re: Export entries to XLS or CSV?, posted by Stefan Ritt on Tue Jun 4 12:38:01 2013 
                icon2.gif   Re: Export entries to XLS or CSV?, posted by Jim Tinlin on Tue Jun 4 16:17:22 2013 
                icon2.gif   Re: Export entries to XLS or CSV?, posted by Jim Tinlin on Tue Jul 2 22:05:06 2013 
                   icon2.gif   Re: Export entries to XLS or CSV?, posted by Andreas Luedeke on Thu Jul 4 15:27:13 2013 elog-2.9.2-2481_cvs3patch.diff
                      icon2.gif   Re: Export entries to XLS or CSV?, posted by Stefan Ritt on Fri Feb 21 13:25:55 2014 
Message ID: 67546     Entry time: Thu Jul 4 15:27:13 2013     In reply to: 67545     Reply to this: 67667
Icon: Reply  Author: Andreas Luedeke  Author Email: andreas.luedeke@psi.ch 
Category: Bug fix  OS: All  ELOG Version: 2.9.2-2481 
Subject: Re: Export entries to XLS or CSV? 

Jim Tinlin wrote:

Stefan Ritt wrote:

Andreas Luedeke wrote:

 

Yes, you're right: the text field is only exported in XML and Raw mode.
It is questionable how EXCEL should cope with HTML or ELCode output from the text fields.
But I admit that this would be a useful feature for logbooks that only use plain text entries. And it is simple to implement.
 
I've attached a patch to elogd.c from elog-2.9.2-2081 that adds a third CVS mode 'CSV (";" separated) + Text'.
(This string has not yet been added to the localization.)
As far as I've tested it works fine to import the text to OpenOffice and EXCEL, even with multiple text lines and HTML code in the text.
Of course the spreadsheet programs just display the HTML source.
 
Stefan, do you think this should be added to the official branch? 
Detect language » English
 
 
Detect language » English
 

Hi Jim, can you confirm that this works for you? If so, I'm willing to incorporate the patch into the distribution. 

 Has this been added yet?

I don't have the means to create an executable for Windows, if someone does I can give it a try...it sounds/looks like it will work.

Thanks!

Hi Jim, I've incorporated the patch to our production server about a week ago.
I've agreed with Stefan that he'll add it, when it proved to run stable for a while.
Until now it appears to work fine. I think Stefan will add it to the distribution soon.
But I won't touch any Windows systems, you'll need to wait for someone else to compile it for you.
Maybe some skilled Windows user want to give it a try: i've attached the changes in the elogd.c file from v2.9.2-2481,
the modified file can be currently downloaded from http://people.web.psi.ch/luedeke/public/tmp/elogd.c
 
Detect language » English
 

Andreas

 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
Attachment 1: elog-2.9.2-2481_cvs3patch.diff  3 kB  | Hide | Hide all
11597c11597
<    rsprintf("<tr><td class=\"form1\"><table><tr><td valign=\"top\" class=\"form1\">\n");
---
>    rsprintf("<tr><td class=\"form1\">\n");
11599c11599
<    rsprintf("<b>%s:</b>
", loc("Mode")); --- > rsprintf("<b>%s:</b>&nbsp;&nbsp;", loc("Mode")); 11609c11609 < rsprintf("<label for=\"full\">%s&nbsp;&nbsp;</label>
\n", loc("Display full entries")); --- > rsprintf("<label for=\"full\">%s&nbsp;&nbsp;</label>\n", loc("Display full entries")); 11615c11615 < rsprintf("<label for=\"summary\">%s&nbsp;&nbsp;</label>
\n", loc("Summary only")); --- > rsprintf("<label for=\"summary\">%s&nbsp;&nbsp;</label>\n", loc("Summary only")); 11622c11622 < rsprintf("<label for=\"summary\">%s&nbsp;&nbsp;</label>
\n", loc("Summary")); --- > rsprintf("<label for=\"summary\">%s&nbsp;&nbsp;</label>\n", loc("Summary")); 11631c11631 < rsprintf("</td><td valign=\"top\" class=\"form1\"><b>%s:</b>
", loc("Export to")); --- > rsprintf("<b>%s:</b>&nbsp;&nbsp;", loc("Export to")); 11637c11637 < rsprintf("<label for=\"CSV1\">%s&nbsp;&nbsp;</label>
\n", loc("CSV (\",\" separated)")); --- > rsprintf("<label for=\"CSV1\">%s&nbsp;&nbsp;</label>\n", loc("CSV (\",\" separated)")); 11643,11649c11643 < rsprintf("<label for=\"CSV2\">%s&nbsp;&nbsp;</label>
\n", loc("CSV (\";\" separated)")); < < if (strieq(mode, "CSV3")) < rsprintf("<input type=radio id=\"CSV3\" name=\"mode\" value=\"CSV3\" checked>"); < else < rsprintf("<input type=radio id=\"CSV3\" name=\"mode\" value=\"CSV3\">"); < rsprintf("<label for=\"CSV3\">%s&nbsp;&nbsp;</label>
\n", loc("CSV (\";\" separated) + Text")); --- > rsprintf("<label for=\"CSV2\">%s&nbsp;&nbsp;</label>\n", loc("CSV (\";\" separated)")); 11655c11649 < rsprintf("<label for=\"XML\">XML&nbsp;&nbsp;</label>
\n"); --- > rsprintf("<label for=\"XML\">XML&nbsp;&nbsp;</label>\n"); 11661c11655 < rsprintf("<label for=\"Raw\">Raw&nbsp;&nbsp;</label>
\n"); --- > rsprintf("<label for=\"Raw\">Raw&nbsp;&nbsp;</label>\n"); 11663c11657 < rsprintf("</td>\n"); --- > rsprintf("</td></tr>\n"); 11665c11659 < rsprintf("<td valign=\"top\" class=\"form2\"><b>%s:</b>
", loc("Options")); --- > rsprintf("<tr><td class=\"form2\"><b>%s:</b>
", loc("Options")); 11707c11701 < rsprintf("</td></tr></table></td></tr>\n"); --- > rsprintf("</td></tr>\n"); 19535c19529 < csv = strieq(mode, "CSV1") || strieq(mode, "CSV2") || strieq(mode, "CSV3"); --- > csv = strieq(mode, "CSV1") || strieq(mode, "CSV2"); 20266,20268c20260 < } else { < if (strieq(mode, "CSV3")) < rsprintf(";\"Text\""); --- > } else 20270d20261 < } 20973,20987c20964 < } else { < if (strlen(text)>0 && strieq(mode, "CSV3")) { < rsprintf(";"); < strlcpy(str, text, sizeof(str)); < rsputs("\""); < pt1 = str; < while ((pt2 = strchr(pt1, '"')) != NULL) { < *pt2 = 0; < rsputs(pt1); < rsputs("\"\""); < pt1 = pt2 + 1; < } < rsputs(pt1); < rsputs("\""); < } --- > } else 20989d20965 < }
ELOG V3.1.5-fe60aaf