If, by chance, your CSV text is the result of an ExecuteSql function call, keep in mind that you can use the double-pipe || concatentation operator to tailor the Sql output to be very close to the HTML table that you are looking to create.
In such a case, your work is almost done -- the only issue may be whether or not it will be necessary to process the output so that certain characters are properly escaped for HTML.
The csv is a result of ExecuteSQL. Would you mind elaborating on how using the || character instead of , will help?
Thanks for the help!
Let's say, for instance, that right now, you are using ExecuteSql similar to this:
varQuery = "SELECT ID, StartDate, EndDate, Locations FROM MyTable WHERE ID > 0";
ExecuteSQL( varQuery; ""; ""; "" )
In which case your output might look something like this:
The joy of the || operator is that it allows you to perform string concatenations in the SQL output.
You can take advantage of this feature to do something similar to this:
varQuery = "SELECT '<a href=\"fmp://etc-etc-etc-insert-proper-URL-here?' || ID || '\"><span>' || StartDate || '</span>' || EndDate || '</span>' || Locations || '</span></a>' FROM MyTable WHERE ID > 0"
ExecuteSQL( varQuery2; ""; ""; "" )
Which would yield output something like this:
I'd suggest playing around with this example, and I believe that you will be able to easily produce the results that you are looking for.
1) Pay close attention to the placement of both your single and double quote chars -- a small mistake will cause you an error which can be difficult to trace.
2) If your data (I'm thinking of the locations field, in particular) contains characters that need to be HTML escaped (such as a < char), then you will need to improve upon this idea slightly to ensure that your data is properly escaped by the time it is in HTML format. This could be perhaps accomplished by performing a carefully crafted Substitute on your SQL output, or, if you are willing to add one more field to your schema, you could add an HTML-escaped version of the location field which can be used especially for this query.
Hope this helps, and good luck!
That'll do it!
Excellent! Glad it worked out!