整理代码
This commit is contained in:
@@ -130,8 +130,8 @@ public class CsvSource:IDataSource
|
||||
public virtual async Task GetHeaderAndCsvFiles()
|
||||
{
|
||||
var text = await File.ReadAllTextAsync(_sqlFilePath);
|
||||
headers = await DumpDataHelper.GetCsvHeadersFromSqlFileAsync(text);
|
||||
csvFiles = await DumpDataHelper.GetCsvFileNamesFromSqlFileAsync(text, new Regex(@"'.+\.dat.zst'"));
|
||||
headers = DumpDataHelper.GetCsvHeadersFromSqlFileAsync(text);
|
||||
csvFiles = DumpDataHelper.GetCsvFileNamesFromSqlFileAsync(text, new Regex(@"'.+\.dat.zst'"));
|
||||
|
||||
}
|
||||
public virtual async Task DoEnqueue(Action<DataRecord> action)
|
||||
@@ -140,9 +140,9 @@ public class CsvSource:IDataSource
|
||||
foreach (var file in csvFiles)
|
||||
{
|
||||
var filePath= Path.Combine(_inputDir, file);
|
||||
using (var fs = File.OpenRead(filePath))
|
||||
using var fs = File.OpenRead(filePath);
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(fs))
|
||||
using StreamReader sr = new (fs);
|
||||
{
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
@@ -164,9 +164,9 @@ public class CsvSource:IDataSource
|
||||
if (file != null)
|
||||
{
|
||||
var filePath = Path.Combine(_inputDir, file);
|
||||
using (var fs = File.OpenRead(filePath))
|
||||
using var fs = File.OpenRead(filePath);
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(fs))
|
||||
using StreamReader sr = new(fs);
|
||||
{
|
||||
var line = await sr.ReadLineAsync();
|
||||
var fields = ParseRow2(line, QuoteChar, Delimiter);
|
||||
|
Reference in New Issue
Block a user