如何使用C#和/或Notepad ++在文本行的前面添加连续数字?

deu*_*on0 0 c# notepad++

我基本上有一个完整的数据列表,如下所示:

text', 0, 16, 0, 160),
text text', 0, 36, 0, 720),
text text text', 6, 14, 200, 400),
text text', 6, 20, 40, 185),
text text text text', 6, 6, 80, 80),
text text', 0, 18, 0, 260),
text text text', 3, 3, 60, 60),
Run Code Online (Sandbox Code Playgroud)

我需要这个看起来像这样:

(1444, text text', 0, 36, 0, 720),
(1445, text text text', 6, 14, 200, 400),
(1446, text text', 6, 20, 40, 185),
(1447, text text text text', 6, 6, 80, 80),
(1448, text text', 0, 18, 0, 260),
(1449, text text text', 3, 3, 60, 60),
Run Code Online (Sandbox Code Playgroud)

所以我基本上在C#中写了一个for循环来生成数字:

 for(int i =0; i < amount; i ++)
        {
            Console.WriteLine("("+counter+",");
            counter++;
        }
Run Code Online (Sandbox Code Playgroud)

计数器是我需要的数字,数量是我需要数字生成的次数.

我试图找出如何得到"(1111,"在"文本"前面,0,0,0,0),"每一行,我试图找到并替换记事本但我无法得到它工作,有没有办法在C#中完成整个事情?或者任何其他方式?

Aus*_*nen 5

var indexedLines = yourData.Select((line, idx) => new {Line = line, Index = idx});

foreach(var indexedLine in indexedLines)
    Console.WriteLine("({0}, {1}", indexedLine.Index, indexedLine.Line);
Run Code Online (Sandbox Code Playgroud)