Add tags

Add tags to the following comment

一行づつ処理します。正規表現を使う必要はあまりないかも。

 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).

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...