-module(parse).

-export([parse/1]).

parse(FileName) ->
  {ok, F} = file:open(FileName, [read]),
  try
    process(F)
  after
    file:close(F)
  end.

process(F) ->
  process(F, io:get_line(F, '')).

process(_F, eof) ->
  ok;
process(F, Line) ->
  Tokens = string:tokens(Line, "|"),
  io:format("~p", [Tokens]),
  process(F, io:get_line(F, '')).

