![]() |
|
[.NET] creating multiple txt files and directories from csv column and have the txt files fi - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] creating multiple txt files and directories from csv column and have the txt files fi (/showthread.php?tid=5746090) |
creating multiple txt files and directories from csv column and have the txt files fi - Haxor1974 - Oct 31, 2017 I have an excel file containing MANY names column and many links column, i need to create directories and text files inside them based on the excel column *. text files filled with same text inside them Lets say i have an excel file containing column:banana,apple The output would be Banana directory,apple directory. Inside apple directory apple.text,inside banana directory a file called banana.text. Inside the text files banana.text and apple.text i would like to have the same specific text WITH the links as variable inside banana.txt the same text with the apropriate link to banana in the paralel link's column and for apple.text same specific text with the appropriate link to apple in the apple link's column pls . RE: creating multiple txt files and directories from csv column and have the txt files fi - Omtism - Oct 31, 2017 Can't you just export the excel file as xml? Bam ding damn bam done. RE: creating multiple txt files and directories from csv column and have the txt files fi - ppaida - Oct 31, 2017 use csvhelper (nuget CsvHelper) to parse, then iterate through your 2d array using two nested for/foreach loops using DirectoryInfo to create directories and File.Write() for the file name and content. add logic to put whatever you need into the content accordingly |