public Tuple<List<FieldImports>, bool> ReadTxtFile(string filePath)
{
string[] textData = System.IO.File.ReadAllLines(filePath);
string[] headers = textData[0].Split('\t');
DataTable dataTable1 = new DataTable();
foreach (string header in headers)
dataTable1.Columns.Add(header, typeof(string), null);
for (int i = 1; i < textData.Length; i++)
{
dataTable1.Rows.Add(textData[i].Split('\t'));
}
// var columnListData = new List<FieldImports>();
// var fileInLines = File.ReadAllLines(filePath);
//// foreach (var line in fileInLines)
// for (var line = 0; line < fileInLines.Length; line++)
// {
// var fileAttributes = fileInLines[0].Split('\t');
// var fieldImportsData = new FieldImports();
// var fieldAttributes = fileInLines[line + 1].Split('\t');
// fieldImportsData.ColumnName = fileAttributes[0];
// //for (var i = 0; i < fileAttributes[i+1].Length; i++)
// //{
// fieldImportsData.ColumnValue = fieldAttributes[line];
// // }
// columnListData.Add(fieldImportsData);
// }
// return new Tuple<List<FieldImports>, bool>(columnListData, false);
return null;
}
{
string[] textData = System.IO.File.ReadAllLines(filePath);
string[] headers = textData[0].Split('\t');
DataTable dataTable1 = new DataTable();
foreach (string header in headers)
dataTable1.Columns.Add(header, typeof(string), null);
for (int i = 1; i < textData.Length; i++)
{
dataTable1.Rows.Add(textData[i].Split('\t'));
}
// var columnListData = new List<FieldImports>();
// var fileInLines = File.ReadAllLines(filePath);
//// foreach (var line in fileInLines)
// for (var line = 0; line < fileInLines.Length; line++)
// {
// var fileAttributes = fileInLines[0].Split('\t');
// var fieldImportsData = new FieldImports();
// var fieldAttributes = fileInLines[line + 1].Split('\t');
// fieldImportsData.ColumnName = fileAttributes[0];
// //for (var i = 0; i < fileAttributes[i+1].Length; i++)
// //{
// fieldImportsData.ColumnValue = fieldAttributes[line];
// // }
// columnListData.Add(fieldImportsData);
// }
// return new Tuple<List<FieldImports>, bool>(columnListData, false);
return null;
}