Publish in CSV format or convert the html results output to csv format

Hello,

Our fleet is having our web page redesigned using Word Press in the hope the site will be easier to maintain. One of the questions from the developer to me is could I publish or provide the results file in a CSV format instead of html for display on the results page of the new Word Press Web site. I currently publish the results html, ( I believe the only published format) and use MS Word as my html editor. After the results are saved they are FTP ed up to the server and are now available for display on the results page on our current web site. The developer is saying a CSV file would integrate in the Word Press site easily, and while it can be done in HTML it will be more labor intensive, and cumbersome. Based on past experience often times file conversion converts most of the data but leaves you will display format issues.

Does anyone know of a way to publish or convert the html results to a csv format?

Current site: www.lscf.us

Thank You,

George Morin

Lake Sunapee Cruising Fleet

Sunapee, NH

George,

Another approach might be to publish in HTML as usual and then print it to a PDF file. Most web systems can handle PDFs with ease, and you maintain control over the SW look and feel.

I expect that, one day, SW will offer a direct print to PDF; in the meantime there are plenty of free utilities around that you can use.

jrc

···

John Culter - Mobile
(604) 742-8832
jrculter@medi.net

On May 3, 2016 9:14 AM, “e.executive@comcast.net [sailwave]” sailwave@yahoogroups.com wrote:

Hello,

Our fleet is having our web page redesigned using Word Press in the hope the site will be easier to maintain. One of the questions from the developer to me is could I publish or provide the results file in a CSV format instead of html for display on the results page of the new Word Press Web site. I currently publish the results html, ( I believe the only published format) and use MS Word as my html editor. After the results are saved they are FTP ed up to the server and are now available for display on the results page on our current web site. The developer is saying a CSV file would integrate in the Word Press site easily, and while it can be done in HTML it will be more labor intensive, and cumbersome. Based on past experience often times file conversion converts most of the data but leaves you will display format issues.

Does anyone know of a way to publish or convert the html results to a csv format?

Current site: www.lscf.us

Thank You,

George Morin

Lake Sunapee Cruising Fleet

Sunapee, NH

Hi,

I went through this when we put our website onto WordPress. Although I didn’t search too hard, but from what I can see there is no other option than html.

For a developer - converting HTML (in a table format, which the results are) into CSV is very straight forward.

Although I didn’t take this route, as it is far simpler to avoid two steps and to read teh relevant part of the HTML file straight into the appropriate WordPress template. Getting the results HTML code into the page template stripping teh un needed HTML is 11 lines of code.

I know not all WordPress developers are indeed ‘developers’ more plugin installers, I have offerred in teh past to package up my code into a plugin, but there were no takers.

Alan

fyi this is the way it looks on our site

Results - Papercourt Sailing Club

Results - Papercourt Sailing Club
© 2015 Papercourt Sailing Club Limited, Company number 01458210 - Polesden Lane, Ripley, Surrey, GU23 6JX Telephone 01483 223904 Email Us

View on www.papercourt-sc.org.uk

Preview by Yahoo

Hi,

  If you have Excel installed on the same PC as Sailwave you can

publish to Excel. You would then be able to save a CSV file. But
remember please to keep the footer information in any results
published using the CSV, i.e . the link to the Sailwave web
site and information about the version being used. Also include a
Sailwave logo on the web site somewhere.

  To publish to Excel, when publishing click the down arrow beside

Destination” in the “* Publish web page - destination
options*” window and select "An installed application "
and either browse to where excel executable installed or click MS
Excel button.

Hope this is useful.

Kind regards,

Huw

···

0On 03/05/2016 17:14,
[sailwave] wrote:

e.executive@comcast.net

Hello,

            Our fleet is having our web page redesigned using

Word Press in the hope the site will be easier to
maintain. One of the questions from the developer to me
is could I publish or provide the results file in a CSV
format instead of html for display on the results page
of the new Word Press Web site. I currently publish the
results html, ( I believe the only published format) and
use MS Word as my html editor. After the results are
saved they are FTP ed up to the server and are now
available for display on the results page on our
current web site. The developer is saying a CSV file
would integrate in the Word Press site easily, and while
it can be done in HTML it will be more labor intensive,
and cumbersome. Based on past experience often times
file conversion converts most of the data but leaves you
will display format issues.

            Does anyone know of a way to publish or convert the

html results to a csv format?

Current site: www.lscf.us

Thank You,

George Morin

Lake Sunapee Cruising Fleet

Sunapee, NH


Virus-free. www.avast.com

Hi George - As always there are various options available to you but there are many clubs that use Wordpress and some of them very successfully use the html output.

csv format is not very suitable for results in general. csv works for a single table but results often consist of multiple tables e.g. the series and the individual races. Also the results do contain other info.

Version 2.20 of Sailwave (not released yet) does have a publish to XML which can be useful in some circumstances but for general use the HTML is the best. I have also played with a non released version of Sailwave which also supports publishing both to PDF and to an image JPG/PNG but the size of the install does get a lot bigger and although these features work under windows there are potential problems for Apple and Linux users. If there is significant interest in the PDF and the image version, I’ll resurrect the development of that. Publishing to a PDF is straightforward with Chrome as it has PDF converter built-in

Jon

···

On 3 May 2016 at 17:14, e.executive@comcast.net [sailwave] sailwave@yahoogroups.com wrote:

Hello,

Our fleet is having our web page redesigned using Word Press in the hope the site will be easier to maintain. One of the questions from the developer to me is could I publish or provide the results file in a CSV format instead of html for display on the results page of the new Word Press Web site. I currently publish the results html, ( I believe the only published format) and use MS Word as my html editor. After the results are saved they are FTP ed up to the server and are now available for display on the results page on our current web site. The developer is saying a CSV file would integrate in the Word Press site easily, and while it can be done in HTML it will be more labor intensive, and cumbersome. Based on past experience often times file conversion converts most of the data but leaves you will display format issues.

Does anyone know of a way to publish or convert the html results to a csv format?

Current site: www.lscf.us

Thank You,

George Morin

Lake Sunapee Cruising Fleet

Sunapee, NH

Jon Eskdale
07530 112233

Skype “eskdale”

Oh and I forgot, you can export to CSV the series, but it isn’t obviously named.

Its called ‘Export to Windows Clipboard…’ (from file menu)

You can select columns, and delimiter ( comma ) etc. Of course you then need to paste that into something (notepad etc) and then ftp the CSV

Not as neat as just setting the publish FTP and publishing

Haven’t used Wordpress but we are looking to make our web site easier to manage so I’m interested in this topic thread. Feeling I don’t know what the problem is with regards to publishing the Sailwave HTML files using Wordpress. Can someone please explain. Thanks.

···

On 3 May 2016 at 18:10, alan@sailfun.co.uk [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I went through this when we put our website onto WordPress. Although I didn’t search too hard, but from what I can see there is no other option than html.

For a developer - converting HTML (in a table format, which the results are) into CSV is very straight forward.

Although I didn’t take this route, as it is far simpler to avoid two steps and to read teh relevant part of the HTML file straight into the appropriate WordPress template. Getting the results HTML code into the page template stripping teh un needed HTML is 11 lines of code.

I know not all WordPress developers are indeed ‘developers’ more plugin installers, I have offerred in teh past to package up my code into a plugin, but there were no takers.

Alan

Richard
Evans
​w:

www.chanonry.org.uk/results.html

WordPress (and most content management systems - CMS - things that make publishing easier)

have a pre determined ‘structure’ normally made up of components

header

navigation menu(s)

sidebars

content

footer

So using these component structures (themes / templates) make the web pages consistent and combined make up the full HTML for the page.

As the CMS builds the full HTML page, most of teh time the users only have to provide text content.

The issues comes with SailWave - as when it publishes results as HTML it is a full page - head to toe - and tools like WordPress don’t want a full page they just want a component (e.g. content)

So in essence SailWave provides too much - hence the OP’s request to have just the data in CSV not the full ‘page’

I hope my explanation makes some sort of sense.

So for example, in our site - we take the full HTML page provided by SailWave and use a program to strip out the content we want (essentially top & tail it) and then put it to the WordPress template as a component.

There is a template included with the install that is just the tables “Results for a blog” in the Publish menu, easily tweaked to micro focus on the blog of your choice. Then you can select the destination to be “A new post on your blog” and you end up with a new post in a few clicks.

···

On Tue, May 3, 2016 at 9:23 PM, alan@sailfun.co.uk [sailwave] sailwave@yahoogroups.com wrote:

WordPress (and most content management systems - CMS - things that make publishing easier)

have a pre determined ‘structure’ normally made up of components

header

navigation menu(s)

sidebars

content

footer

So using these component structures (themes / templates) make the web pages consistent and combined make up the full HTML for the page.

As the CMS builds the full HTML page, most of teh time the users only have to provide text content.

The issues comes with SailWave - as when it publishes results as HTML it is a full page - head to toe - and tools like WordPress don’t want a full page they just want a component (e.g. content)

So in essence SailWave provides too much - hence the OP’s request to have just the data in CSV not the full ‘page’

I hope my explanation makes some sort of sense.

So for example, in our site - we take the full HTML page provided by SailWave and use a program to strip out the content we want (essentially top & tail it) and then put it to the WordPress template as a component.

Cheers,

Colin J

http://op12no2.me

What I do for our Joomla site is actively strip out the middle part (leaving the Sailwave tail) using a PHP script. I re-use the script for each page with results, only changing the file name. The script itself is embedded in a CMS article, so it works every time the page is viewed. I don’t think it would be much different for WordPress. You do need an add-on for your CMS that allows PHP and Javascript to be executed from a content page.

The challenge with giving your developer a CSV file every time you want to publish is the speed (or lack of) at which you can do it. I suspect the workflow might be something like score/rescore->save to Windows Clipboard->email to developer->developer puts a new instance of the scoring on the site. If you are in a situation where you are making changes due to protests and redress after a day of sailing, I can imagine this process might become pretty cumbersome.

If you are using the Sailwave tools for online publishing, your workflow would be simply score/rescore->FTP upload. Let the CMS do the dirty work of stripping out what you don’t need.

The results can be pretty satisfying, and you still have the option of including some of the add-ons that can really make the results look great.

This current script has evolved to the point where it sorts table columns, highlights 1,2,3 (basically Jon’s Javascript add-ons integrated into the script), and converts character encoding to UTF-8 for our Joomla site. All I have to do the change it is to change the filename that it works on when I want to display results for a new series.

Here’s what it looks like:

Women’s Radial

image

Women’s Radial
The web site of the Laser World Championships 2016.

View on www.laserworlds2016…

Preview by Yahoo

One last thing: have a look at the template and style files, and things like header.txt and footer.txt. It’s pretty simple to copy those and create your own, including things you want on the uploaded results and not other things. For example, you might be able to create an upload file that will be something you can upload quickly and your developer will accept. Something like “Results for a Blog” perhaps?

Hi Andy,

  Very interesting what you have done. As you use a Joomla plug-in

to allow PHP & Javascript [I take it something like ], I assume you
could include a report on the event/days sailing if you wanted to.
I would be very interested in having a copy of your script and the
details on the Joomal PHP plug-in you use.

  Your solution seems simpler than another posted using your ideas

made into a Joomla add-in, which so far I have been unable to get
working.

  I agree that the publishing flow should be as simple as possible,

i.e . just publishing to an FTP destination, as it is the
least error prone and fastest solution for making results
available. I try now to always publish to FTP destination, either
custom or Sailwave results sub-folder, and if a printed copy is
required call up the results page from the event web site and
print using browser print options. This has the advantage in that
printed version & the published on the web site version are
identical, i.e. the time stamp is the same.

Hope you are surviving all the Laser events you are hosting.

Kind regards,

Huw

···

http://extensions.joomla.org/extension/sourcerer
On 04/05/2016 14:12, [sailwave] wrote:

andy@sailor.nu

          What I do for our Joomla site is actively strip out the

middle part (leaving the Sailwave tail) using a PHP
script. I re-use the script for each page with results,
only changing the file name. The script itself is embedded
in a CMS article, so it works every time the page is
viewed. I don’t think it would be much different for
WordPress. You do need an add-on for your CMS that allows
PHP and Javascript to be executed from a content page.

          The challenge with giving your developer a CSV file

every time you want to publish is the speed (or lack of)
at which you can do it. I suspect the workflow might be
something like score/rescore->save to Windows
Clipboard->email to developer->developer puts a new
instance of the scoring on the site. If you are in a
situation where you are making changes due to protests and
redress after a day of sailing, I can imagine this process
might become pretty cumbersome.

          If you are using the Sailwave tools for online

publishing, your workflow would be simply
score/rescore->FTP upload. Let the CMS do the dirty
work of stripping out what you don’t need.

          The results can be pretty satisfying, and you still

have the option of including some of the add-ons that can
really make the results look great.

          This current script has evolved to the point where

it sorts table columns, highlights 1,2,3 (basically Jon’s
Javascript add-ons integrated into the script), and
converts character encoding to UTF-8 for our Joomla site.
All I have to do the change it is to change the filename
that it works on when I want to display results for a new
series.

Here’s what it looks like:

Women’s
Radial


image


Women’s
Radial

The web site of the
Laser World Championships 2016.

[

                            View on www.laserworlds2016...
                      ](http://www.laserworlds2016.org/index.php/results-2/women-s-radial)
                        Preview by Yahoo
            One last thing: have a look at the template and style

files, and things like header.txt and footer.txt. It’s
pretty simple to copy those and create your own,
including things you want on the uploaded results and
not other things. For example, you might be able to
create an upload file that will be something you can
upload quickly and your developer will accept. Something
like “Results for a Blog” perhaps?


Virus-free. www.avast.com

Lol. Yeah, the Laser Worlds have become a bit like Groundhog Day. Two months of Laser championships! What were we thinking?!? We are in the middle of a 10 day break, then we have Laser Standards Worlds, followed closely by Master’s Standards Worlds.

I also use Sourcerer for Joomla. In order to make my script work, you need to un-blacklist the “file” command. Not optimum, but it isn’t super risky. Also, you need to know that once you apply this script (using something like Codemirror), when you save it, you’ll get a blank screen with an error message. That basically is telling you that you succeeded - the script is trying to call a file that isn’t there. It should display properly when you call it from a Joomla menu item.

Here’s the script I’m using. Hopefully it’s commented well enough to make it understandable. The Javascript is thanks to Jon’s good work, the PHP is my own. I’ve still not been able to figure out a good way to change character encoding so that special characters display properly - right now I’m just manually identifying the errors and changing them to characters that UTF-8 can display properly.

Just open a new article with CodeMirror, dump this inside, change the file path to your Sailwave file, and Robert is your Mother’s Brother…

body {font: 80% arial, helvetica, sans-serif;} .hardleft {text-align: left; float: left; margin: 15px 0 15px 25px;} .hardright {text-align: right; float: right; margin: 15px 25px 15px 0;} table {text-align: left; margin: 0px auto 30px auto; font-size: 1em; border-collapse: collapse; border: 2px #008 solid;} td, th {padding: 4px; border: 1px #008 solid; vertical-align: top; color: black;} .caption {padding: 5px; text-align: center; border: 0;} th {background-color: #B0AEAE; font-weight: bold;} h1 {font-size: 1.6em; text-align: center;} h2 {font-size: 1.4em;text-align: center;} h3 {font-size: 1.2em;text-align: center;} p {text-align: center;} .even {background-color: #f0f0f0;} .odd {background-color: #fff;} .contents {text-align: left; margin-left: 20%;} .natflag {border: 1px #999 solid;width:28px;} .nattext {font-size: 0.8em;} .place1 {font-weight: bold; background-color: #ffffaa;} .place2 {font-weight: bold; background-color: #aaaaff;} .place3 {font-weight: bold; background-color: #ffaaaa;} .placen {} div.scroll { width: 100%; height: 1200px; overflow: scroll; } <?php // set source file name and path $source = "../race/laserworlds/lasermastersradialresults.htm"; $scorestart = "<h3 class="; $scoreend = ""; $scorestartKey = 0; $scoreendKey = 0; // read raw text as array $raw = file($source) or die("Cannot read file"); // join remaining data into string $data = join('', $raw); //find the substrings $scorestartKey = strpos ( $data , $scorestart ); $scoreendKey = strpos ( $data , $scoreend ); //pull out just the results and the Sailwave footer $html=substr ( $data , $scorestartKey , $scoreendKey-$scorestartKey ); //make is scroll (for phones) echo '
'; //put it on the page echo $html; echo '
'; ?>

For original Sailwave file, click here

Thank you for your reply … George