tsinvest file format

From: John Conover <john@email.johncon.com>
Subject: tsinvest file format
Date: 1 Jan 2001 23:32:49 -0000

BTW, if you want to change tsinvest's native file format to read csv
spreadsheet format files directly, (which is used by Yahoo!'s quote
and historical database servers,) you might want to change the
"#define TOKEN_SEPARATORS" just above main (), from white space to a
comma-this controls the parsing field separator character(s) used in
strtoken (), which is the data file parser for tsinvest.

The data file parser, strtoken (), parses the fields into a character
array, token[], which is used ONLY in the lines of main ():

    if ((fields = strtoken (buffer, parsebuffer, token, TOKEN_SEPARATORS)) != 0) /* parse the stock's record into fields, skip the record if there are no fields */

with token[0] containing either a '#' for a comment record, and if it
is not a comment, it is the time stamp of a ticker record; token[1]
will then contain the ticker symbol of the stock; and token[2] will
contain the value of the stock at that time.

See main (), in csv2tsinvest.c for an example.



John Conover, john@email.johncon.com, http://www.johncon.com/

Copyright © 2001 John Conover, john@email.johncon.com. All Rights Reserved.
Last modified: Fri Jan 5 22:28:03 PST 2001 $Id: 010101153308.20387.html,v 1.0 2001/11/17 23:05:50 conover Exp $
Valid HTML 4.0!