Difference between revisions of "Delimiter-separated Values Channel Report"

From AwasuWiki
Jump to: navigation, search
m
(Added link to ZIP file)
Line 31: Line 31:
 
"{%CHANNEL-METADATA% name}","{%CHANNEL-METADATA% homeUrl encode=sgml chars=<&\"}","{%ITEM-METADATA% name!}","{%ITEM-METADATA% url encode=sgml chars=<&\"}"{%?WORKPAD-NAME%},"{%ITEM-NOTES%}"{%ENDIF%}{%/REPEAT%}
 
"{%CHANNEL-METADATA% name}","{%CHANNEL-METADATA% homeUrl encode=sgml chars=<&\"}","{%ITEM-METADATA% name!}","{%ITEM-METADATA% url encode=sgml chars=<&\"}"{%?WORKPAD-NAME%},"{%ITEM-NOTES%}"{%ENDIF%}{%/REPEAT%}
 
</pre>
 
</pre>
 +
 +
 +
Download and unpack this [http://awasu.com/downloads/extensions/DelimiterSeparatedValuesChannelReport/DelimiterSeparatedValuesChannelReport-v1.zip ZIP file] to the Resources/Report Templates directory (under the Awasu installation directory).
 +
  
 
If you save the output of this Channel Report to a file name with an extension of .CSV you should be able to double-click the .CSV file to open it in Excel or whatever program you have associated with the .CSV extension.
 
If you save the output of this Channel Report to a file name with an extension of .CSV you should be able to double-click the .CSV file to open it in Excel or whatever program you have associated with the .CSV extension.

Revision as of 07:54, 11 March 2011

The delimiter-separated values file format is one of the oldest and most widely supported machine-readable file formats. Data is stored in a two-dimensional array where each field (or column) is delimited by a specific value and each line (or row), representing another record of data, is delimited by an end-of line character.

In this example I'm using a comma as the field delimited, but you can us a different character if you want/need to.

Note:

  1. By enclosing the each field's values with a pair of quotation marks we should be able to prevent any commas in the actual field values from being interpreted as a field separator.
  2. Because the end-of-line character is just as critical to the ensure that the resulting file is correctly parsed, you must take special care where you place the {%REPEAT%} and {%/REPEAT%} tags. Awasu will insert an end-of-line character after both of these tags so they must appear on the same line as your Awasu parameter tags.


This comma-separated values Channel Report (displayed below and linked to this page) will work slightly differently if the data source is a Workpad vs. a Channel Filter or a Folder. Since the Item Notes field isn't applicable when your feed items are sourced from a Channel Filter or a Folder, we won't output it.


For a Workpad-based Channel Report the following fields are displayed:

  • Channel Name
  • Home URL
  • Item Title
  • Item URL
  • Item Notes

For a Channel Filter or Folder-based Channel Report the following fields are displayed:

  • Channel Name
  • Home URL
  • Item Title
  • Item URL
"Channel Name","Home URL","Item Title","Item URL"{%?WORKPAD-NAME%},"Item Notes"{%ENDIF%}{%REPEAT% FeedItems}
"{%CHANNEL-METADATA% name}","{%CHANNEL-METADATA% homeUrl encode=sgml chars=<&\"}","{%ITEM-METADATA% name!}","{%ITEM-METADATA% url encode=sgml chars=<&\"}"{%?WORKPAD-NAME%},"{%ITEM-NOTES%}"{%ENDIF%}{%/REPEAT%}


Download and unpack this ZIP file to the Resources/Report Templates directory (under the Awasu installation directory).


If you save the output of this Channel Report to a file name with an extension of .CSV you should be able to double-click the .CSV file to open it in Excel or whatever program you have associated with the .CSV extension.

And then there's our old friend the Post Processing Open Command which can automatically open this Channel Report in whatever program you have associated with the .CSV extension every time you run this Channel Report:

cmd /c start {%REPORT-FILENAME%}

Of course, instead of using this generic "open" post-processing command you can always specify the path to a specific program that you'd like to open the .CSV file in too:

"L:\PortableApps\OpenOfficePortable\OpenOfficeCalcPortable.exe" {%REPORT-FILENAME%}