I am using following code to split a text file where the file path is provided through textbox

string[] allFiles = System.IO.Directory.GetFiles(@"textBox1.Text);
            foreach (string file in allFiles)

            Regex.Split(textBox1.Text, {"<ty>"});

but getting an error
My need is read a large text file and split it based on <th> tag and save them as different text files
thnks in advance

Recommended Answers

All 2 Replies

Have a look here

Line one should read

string[] allFiles = System.IO.Directory.GetFiles(textBox1.Text);
commented: you have the eye of an eagle +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.