Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys. I need help with my coding
so far i got it to work as a application that combines all the text file that i need.
Now I need to do is from the 2nd text file onward, I have to remove the first 55 lines of the added text file. :) Appreciate the help.

C#
Stream myStream;
OpenFileDialog FileDialog1 = new OpenFileDialog();


if (FileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
    if ((myStream = FileDialog1.OpenFile()) != null)
    {
        string strfilename = FileDialog1.FileName;
        string filetext = File.ReadAllText(strfilename);
        directorylistbox.Items.Add(strfilename + "\n");
        finalresult.AppendText(filetext);
    }
}
Posted
Updated 27-Sep-15 20:50pm
v3
Comments
Sinisa Hajnal 28-Sep-15 2:37am    
So, what is the problem? If you need the text from second file, don't add first one into the final result. If you need it, skip the lines. Or delete them.
Member 12015831 28-Sep-15 2:49am    
when i adding the 2nd file onward, i don't want the first 55 lines to be loaded to the richtextbox.
Sinisa Hajnal 28-Sep-15 4:36am    
Yes, but you didn't answer my question. Is the problem that you need all files in final result and just want to load part of it into textbox? You know, WHY are you even loading first file if you don't need it? Also, what is the problem with removing first x lines? Examples are easily found.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900