//fileName为csv文件的路径,targetValue为指定字符串
public void SelectRowInTheCsv1(string fileName, string targetValue)
{
StreamReader sr = new StreamReader(fileName);
string[] readText = File.ReadAllLines(fileName);//逐行读取文件并标注行列
string targetRow = "";//目标行
//搜索字符串所在的行
for (int i = 0; i < readText.Length; i++)
{
string[] strNew = readText[i].Split(new char[] { ' ', '\t', '\n' }, StringSplitOptions.RemoveEmptyEntries);
List<string> itemsList = new List<string>(strNew);
List<string> itemsListFind = itemsList.FindAll(
delegate (string item)
{
return
item.ToUpper().Contains(tar