Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

creating multiple txt files and directories from csv column and have the txt files fi

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 .
Can't you just export the excel file as xml? Bam ding damn bam done.
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


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersFeb 12, 2025 11:02 PM 3 169 Feb 12, 2025 11:02 PM
Last Post: Phantom_NiNja
[C#] by john ronaldsadJul 20, 2022 06:49 PM 4 232 Jul 20, 2022 06:49 PM
Last Post: john ronaldsad
[C#] by GuillyianJul 11, 2022 05:19 AM 5 227 Jul 11, 2022 05:19 AM
Last Post: MavenGradle