![]() ![]() ![]() Worksheet CurSheet = (.Worksheet)wsSheet Application app = new .ApplicationClass() Or following: public static void SaveAs() wbWorkbook.SaveAs("c:\yourdesiredFilename.csv", .XlFileFormat.xlCSV) Otherwise, a program could read the file as ASCII and choke on the first non-ASCII character encountered.Ĭheckout the. Using (var writer = new StreamWriter(targetFile,false, Encoding.UTF8))Įncoding.UTF8 ensures the file will be written as UTF8 with a Byte Order Mark that allows all programs to understand this is a UTF8 file instead of ASCII. No need for a memory buffer, writing directly to a file Var currentRow = new List(maxColumnNumber) You can write directly to a file instead, if you remove the memory stream and pass the path to the target file in ConvertToCsv : public static void ConvertToCsv(this ExcelPackage package, string targetFile) Then open the attached yxmd file.The code you linked to reads an XLSX sheet and returns the CSV data as a byte buffer through a memory stream. yxmc files to your macros folder (Options->User Settings->Edit User Settings->Macros hit the plus sign, pick your folder). If you don't have this, then save the two attached. You will need the latest version of Alteryx to load this. I've attached the packaged workflow for you (.yxzp file). This will load all files in and create a single table. This allows you to filter out any tabs you don't want. This is then fed into the second customer tool which loads them all in. These are then appended to the full path of the file to give something like:Į:\Dropbox\Bulien\Alteryx\Datasets\Healthcare\10k Diabetes records - File 1.xlsx|||Sheet1 The first custom tool then reads in all tab names within each Excel file. So you would change this in your example to be Report Month*.xlsx ![]() In this example, I'm looking in my healthcare folder for files beginning with "10k" and with the file extension. This uses the Directory tool to search a folder and return the list of all files that share the naming convention: Hi created a couple of tools to do exactly this. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |