-module(file_conv). -export([file_conv/2]). conv(In, Out) -> case io:get_line(In, "") of eof -> true; Line -> case regexp:match(Line, "^#") of nomatch -> io:put_chars(Out, Line); _ -> false end, conv(In, Out) end. file_conv(InFileName, OutFileName) -> {ok, In} = file:open(InFileName, read), {ok, Out} = file:open(OutFileName, write), conv(In, Out).