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

From AwasuWiki
Jump to: navigation, search
(First Draft)
 
m
Line 1: Line 1:
The "[http://en.wikipedia.org/wiki/Delimiter-separated_values 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.
+
The [http://en.wikipedia.org/wiki/Delimiter-separated_values 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 usa different character if you want/need to.
 
In this example I'm using a comma as the field delimited, but you can usa different character if you want/need to.

Revision as of 07:02, 22 September 2010

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 usa 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.


The comma-separated values Channel Report should 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 using 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%}

If you save 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 file in too:

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