vtwntmtn #4782(2007/12/12 17:41 GMT) [ Erlang ] Rating0/0=0.00
一行づつ処理します。正規表現を使う必要はあまりないかも。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
-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).
Rating0/0=0.00-0+
[ reply ]
vtwntmtn
#4782()
[
Erlang
]
Rating0/0=0.00
一行づつ処理します。正規表現を使う必要はあまりないかも。
-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).Rating0/0=0.00-0+
[ reply ]