1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Calligra filters status: CSV FILTER</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#000099" vlink="#666666" alink="#666666">
<A NAME="START"> </A>
<BR>
<center>
<h1>
Calligra filters status: <i>CSV - Comma Separated Values</i>
</h1>
</center>
<hr NOSHADE SIZE=2 WIDTH="70%">
<font size="-1"><b>
<A HREF="#import">Import</A> |
<A HREF="#export">Export</A>
</b></font>
<BR><BR><BR>
<center><a NAME="import"></a></center>
<A HREF="#START"><font size="-1"><b>Up</b></font></A>
<center>
<table BORDER=0 CELLSPACING=0 BGCOLOR="#000000" WIDTH="100%">
<tr>
<td>
<table BORDER=0 CELLPADDING=2 BGCOLOR="#FFFFFF" WIDTH="100%">
<tr BGCOLOR="#DDFFDD">
<td COLSPAN="2">
<center><b><i><font size="+1">
<BR>
Import CSV for KSpread<BR>
<BR>
</font></i></b></center>
</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP WIDTH="1%" NOWRAP><b><font size="+1">Last update</font></b></td>
<td>9 jan 2001</td>
</tr>
<tr BGCOLOR="#CCCCFF">
<td VALIGN=TOP><b><font size="+1">Features</font></b></td>
<td>- Can import CVS documents</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP><b><font size="+1">Todo</font></b></td>
<td>
- Automatically adjust the columns width to their contents.<BR>
Will be difficult, as we don't know the font used...<BR>
Solution ? Set a default font _in_ the filter, and use it to <BR>
compute the width...
</td>
</tr>
<tr BGCOLOR="#CCCCFF">
<td VALIGN=TOP><b><font size="+1">History</font></b></td>
<td>-</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP><b><font size="+1">Authors</font></b></td>
<td>
<A HREF="mailto:faure@kde.org">David Faure</A>
<A HREF="mailto:trobin@kde.org">Werner Trobin</A>
</td>
</tr>
<tr BGCOLOR="#CCCCFF">
<td VALIGN=TOP><b><font size="+1">Links</font></b></td>
<td>-</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP><b><font size="+1">Progress report </font></b></td>
<td>
<H2>Design</H2>
<PRE>
The CSV import filter uses a hand-made state machine to parse the CSV file.
This allows to handle quoted fields (such as those containing the CSV delimiter),
as well as the double-quote character itself (which then appears twice, and
always in a quoted field).
Just to make sure about the vocabulary, I call a quoted field a field
starting with " and finishing with ".
Let's try to draw the graph of the state machine using ascii-art.
DEL or EOL
/--\
| |
| v "
/--[START]-------->[QUOTED_FIELD] (**)
other| ^ ^ | ^
(*) | | | DEL or | " | " (*)
| | | EOL v | other
| | \----[MAYBE_END_OF_QUOTED_FIELD]--------> Error
| |
| | DEL or
| | EOL
v |
[NORMAL_FIELD] (**)
DEL : CSV delimiter (depends on locale !). Often comma, sometimes semicolon.
EOL : End Of Line.
(*) : added to the current field
(**) : implicit loop on itself, labeled "other (*)"
Ugly isn't it ? :) One can't be good in drawings AND in hacking :)
That's all. For the rest, see csvfilter.cc
David Faure <faure@kde.org>, 1999
</PRE>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<A HREF="#START"><font size="-1"><b>Up</b></font></A>
<br><br><br>
<hr NOSHADE SIZE=1>
<br><br><br>
<center>
<a NAME="export"></a>
</center>
<A HREF="#START"><font size="-1"><b>Up</b></font></A>
<center>
<table BORDER=0 CELLSPACING=0 BGCOLOR="#000000" WIDTH="100%">
<tr>
<td>
<table BORDER=0 CELLPADDING=2 BGCOLOR="#FFFFFF" WIDTH="100%">
<tr BGCOLOR="#FFDDDD">
<td COLSPAN="2">
<center><b><i><font size="+1">
<BR>Export KSpread to CSV<BR><BR>
</font></i></b></center>
</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP WIDTH="1%" NOWRAP><b><font size="+1">Last update</font></b></td>
<td>?</td>
</tr>
<tr BGCOLOR="#CCCCFF">
<td VALIGN=TOP><b><font size="+1">Features</font></b></td>
<td>?</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP><b><font size="+1">Todo</font></b></td>
<td>?</td>
</tr>
<tr BGCOLOR="#CCCCFF">
<td VALIGN=TOP><b><font size="+1">History</font></b></td>
<td>-</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP><b><font size="+1">Authors</font></b></td>
<td>
<A HREF="mailto:faure@kde.org">David Faure</A>
<A HREF="mailto:trobin@kde.org">Werner Trobin</A>
</td>
</tr>
<tr BGCOLOR="#CCCCFF">
<td VALIGN=TOP><b><font size="+1">Links</font></b></td>
<td>-</td>
</tr>
<tr BGCOLOR="#EEEEFF">
<td VALIGN=TOP><b><font size="+1">Progress report </font></b></td>
<td>---</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<A HREF="#START"><font size="-1"><b>Up</b></font></A>
</body>
</html>
|