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
19
20
21
using System.IO;
using System.Linq;

class Program
{
    static void Main()
    {
        var header =
            from line in File.ReadAllLines("inFile.txt").Take(1)
            let x = line.Split('\t')
            select x[0] + '\t' + x[2] + '\t' + x[1] + '\t' + x[3];

        var lines =
            from line in File.ReadAllLines("inFile.txt").Skip(1)
            let x = line.Split('\t')
            orderby x[0]
            select x[0] + '\t' + x[2] + '\t' + x[1] + '\t' + (int.Parse(x[3]) + 1);

        File.WriteAllLines("outFile.txt", header.Concat(lines).ToArray());
    }
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...