Sample Guide Process

<< Click to Display Table of Contents >>

Navigation:  Using StreamLab > StreamLab Guides Overview >

Sample Guide Process

Previous pageReturn to chapter overviewNext page

Let's say you start with a simple log file with a stock ticker feed with date, close, volume, open, high, and low:

"2013/05/28","881.2700","2257410.0000","883.5000","892.1400","880.4000"

The log file initially appears in the Output view with two columns, one for rowtime and one column called MESSAGE that contains all the values separated by commas:

sl_sample_process_initial_output_view

Your first step here is to separate out the values. Begin by selecting the MESSAGE column. When you do, StreamLab offers you several suggestions in the Suggestions list:

sl_sample_process_suggestions

At this point you can simply click the + to the right of the first suggestion, "Split column MESSAGE using the automatic pattern Comma-Separated Values (CSV)".

You can also select the Basic:Split command to view more information on the splitting operation.

sl_sample_process_basic_split

Note that the Split command has MESSAGE preselected for the column. That is because you have selected MESSAGE in the Output view. Also note that the options Auto and Comma-Separated Values (CSV) have been preselected. That is because these are the most likely selections for the column.

Click the + sign to the right of the Split...CSV suggestion. The Message column splits into six separate columns.

sl_sample_process_basic_split_result

Next, you want to rename the new columns to date,close,volume,open,high,low. You can do so using the Basic:Rename List command. First, select columns MESSAGE_1 through MESSAGE _6. If it is not already selected, select Basic from the Commands popup menu, then select the Rename List tab.

sl_sample_process_basic_rename_list

Next, enter the following into the To List field:

date,close,volume,open,high,low

Click the + sign to the right of the Rename Columns... suggestion. The columns are renamed:

sl_sample_process_basic_rename_list_result

Next, cast the columns Close, Volume, and Open as column type DOUBLE. You can do so using the Basic:Cast command. First, select columns Close, Volume and Open. Next, select the CAST command and select DOUBLE from type. Note that the three columns appear in the Columns field. Click the + sign to the right of the Cast Columns... suggestion. The columns are cast as DOUBLE.

sl_sample_process_basic_cast

Next, you can create a new column with a running average for close. To do so, select the column Close and choose the Analytics:Running Average command.

sl_sample_process_analytics_running_average

Click the + sign to the right of the Add column named... suggestion. A new column called Avg appears: