Thank you all for supporting this idea!
The basic concept would be to work the csv file as a collection of
rows.
This is well introduced by the fellow who made the php class mentioned
above (who in fact thinks about a grid, but we do have fmt/template to
return not only rows but columns too).
His concept could be enhanced with Boltwire's ability to search.
Imagine Boltwire's index file. It is not a well-formed csv file but
kind of. There are different cases to work with such a file.
1. Doing a search, returns the matching row(s):
[(csv page=some.page find="Bob||Alice")] A search for "Bob" or "Alice"
would get me all rows with the matching values line by line.
2. Doing a search, work on defined values of the matching row(s):
Some more parameters could be:
"delimiter=": defines the colums. Maybe having a default value.
Everything except of \n which defines the row. If nothing there is
only one column. If anything is enclosed in " " the delimiter would be
ignored (therefore you can handle text or "merge columns").
"header=Name,Age,Skill": a custom header row which defines the columns
starting from the first column. A "Name,Age,Skill" would define the
first three columns as found using the delimiter. The remaining
columns would be treated as additional single column. "header=true"
could take the first row of the file as header row.
Now, a search for "Bob" or "Alice" would get me all rows with "Bob" or
"Alice". For each of these rows I would be able to address the defined
3+1 columns, like fmt="Name: {+name}, Age: {+age}, Skill: {+skill},
Whatever: {+lastcolumn}".
Or using a form in a template to work with single fields as defined in
header.
> And then we probably need a command that can save a specific entry in
> the table, maybe something like:
>
> [form]
> [text name]
> [text skill]
> [submit]
> [session csv "page='some.page' find='{=name}' field='{=skill}']
> [form]
>
> This would obviously update the csv file for say Bob to include Java now.
3. Knowing the number(s) of the row(s), work on defined values of the
matching row(s):
[(csv page=some.page row=7,11,33,-22)] returns one or more rows,
exclude row 22. Maybe an additional parameter for the last row would
be nice to have. Returns just these rows as collection of lines if no
fmt or template defined.
4. Knowing the number of the column
[(csv page=some.page delimiter="," header=Name,Age,Skill fmt="Name:
{+name}, Skill: {+skill}")] Using delimiter and header or
header="true" I would be able to define the columns I am looking for.
fmt/template returns the values from each row.
5. Doing a search or having the numbers of rows, deleting this/these
row(s)
[(csv page=some.page find="Bob" template=csv.delete)] Maybe this could
be handled by a template which returns the matching rows line by line
checkboxed, delete rows if checked and purge the csv file. Or action
(?)
6. Appending a row
[(log page=some.page)] adds another line at the end of the file.
7. Get the whole file formatted as a table
[(csv page= header="true" template=csv.table)] shows whole page,
formatted as a table, perhaps integrated with sorttable plugin. Or use
custom header="Name,Age,Skill...". Template or action(?)
> To edit the entire table we could just use the regular page edit
> function I think, or we might need a option for that within the csv
> command.
Agreed.
> Questions: how do you like the syntax?
> And second, should we escape the delimiter automatically when entered into a
> field value? Seems
> reasonable.
> Third, can you think of any other functionality that we might need, that we
> can get when integrating this into BoltWire--with
> all it's other tools?
> Fourth, do we want a special csv folder for these kinds of files or should we
> use regular in-wiki pages?
I think the regular ones would be good.
> Let me know what you think. I'll take a look at putting something
> together. Shouldn't take an hour--once we settle on exactly what we
> want. I'll enjoy it!
Thank you all again. I am looking forward to import my contact
database (45 columns, 4000 rows) into Boltwire.
Greetings, Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---