You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
203 lines
5.1 KiB
203 lines
5.1 KiB
<!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>KOffice filters status: CSV FILTER</title>
|
|
</head>
|
|
<body text="#000000" bgcolor="#FFFFFF" link="#000099" vlink="#666666" alink="#666666">
|
|
<A NAME="START"> </A>
|
|
|
|
<BR>
|
|
<center>
|
|
<h1>
|
|
KOffice 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]-------->[TQUOTED_FIELD] (**)
|
|
other| ^ ^ | ^
|
|
(*) | | | DEL or | " | " (*)
|
|
| | | EOL v | other
|
|
| | \----[MAYBE_END_OF_TQUOTED_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>
|