Remove lines that is shorter than or equal 5 characters after the : using Notepad++

前端 未结 2 1626
滥情空心
滥情空心 2021-01-26 14:20

The question is like: Remove lines that is shorter than 5 characters before the @ using Notepad++

But it differs a bit...

I have like that:

abc

2条回答
  •  别那么骄傲
    2021-01-26 14:59

    Without knowing the language there is only so much help I can offer. I'll give you an example of how I would solve this problem in C#.

    Start by creating a string for your updated file (without the short lines)

    string content = "";

    Read a line in from your file. Then get a substring of the line you read in - the abc: portion and check the length.

    line = line.substring(indexof(":"), length - indexof(":"))
    if(line.length > 5)
    {
      content += line;
    }
    

    At the end, truncate your file and write content to it.

提交回复
热议问题