1

Text file

I want to read all lines and remove id="***". * means any value also want to remove the id= . This is not a HTML or XML. this is txt file. I want result in regex pattern. I have tried all the stack overflow result.

abcd.txt

<table id="tb0705" frame="topbot" rowsep="0" colsep="0">
<label id="lb0015">Table 1.</label>
<para id="para0105">
...

I have already tried.

string []lines=File.ReadAllLines("abcd.txt");
foreach(string line in lines)
{
    string newLine=Regex.Replace(line, @"id=\".\"", "");// this is not replacing
    Console.WriteLine(newLine);
}

Expected result.

<table frame="topbot" rowsep="0" colsep="0">
<label >Table 1.</ce:label>
<para >
...

The pattern remains same for all lines.

Community
  • 1
  • 1

0 Answers0