ots-heading-parser

Reads the contents of a file from The Sports Network and checks the element to figure out what type of file it is.

Heading Parser for Sports Network Data Files

Looks at a file and spits back what's in the heading element. It's meant to tell you which parser to the parser-proxy needs to spawn in order to store the data.

  • --file: the relative or absolute path to the file of interest
  • --filetype: pbp|other pbp can let us know that we don't need to read the file in and examine the <heading> element because it's a known play by play file.
  • --ignore: Tell the heading parser to ignore a letter in the 2nd position of the heading node. e.g. A, B, J to ignore files having to do with a certain sport.
  • --sport: nfl|mlb if the sport type is already known, specify it here.
  • --delim: Defaults to |||, but you can configure it here. WARNING: If filenames contain the delimiter, weird things can happen.
  • --in0: present or not. If this argument is present, it lets us know that the stdin input is delimited by \0 nulls instead of \n newlines.
  • --out0: present of not. If present, delimit the output with \0 nulls instead of \n newlines.

Can come from either stdin if we're piping a large list of files to the parser or just standard command line options specified above.