Hi Everyone,
I have below C# code which i want to run in UiPath using invoke code activity but the program is not compiling and giving errors. Any help would be great.
This program is to merge files.
var allCsv = Directory.EnumerateFiles("C:\Users\Documents\UiPath\Files1", "*.csv", SearchOption.TopDirectoryOnly);
string[] header =
{
File.ReadLines(allCsv.First()).First(l => !string.IsNullOrWhiteSpace(l))
};
// Get CSV Data
var mergedData = allCsv.SelectMany(csv => File.ReadLines(csv).SkipWhile(l => string.IsNullOrWhiteSpace(l)).Skip(1));
// skip header of each file
File.WriteAllLines("C:\Users\Documents\UiPath\test.xlsx", header.Concat(mergedData));
@supermanPunch @Nithinkrishna @ppr can you guys also have a look
Thanks!