I have a application that reads in text files, pulls info out and create one or many new text files based on infomation in the original file. I have done this with VB6 and it flys...now c# appears to be very slow at doing this...
I often deal with fairly large files, I noticed my problem when I came accross a 7+ gig file that after an hour was not done, but it was still processing (this same file was done in VB6 in about a minute or less). Here I am placing the lines I want to write out to a text file in a new string and print the file when completed. I have tried writing the text file line by line, printing into a stringwriter and than print my text file...and this way...Here is a chunk of the code that is being used for this...
public
{
string
//This seems to go very fast....
sLine = sr.ReadToEnd();
sr.Close();
//I do Some Other Functions Here...Determine The File Type And What I Want To Do With It...
//Call Next Function...
sReturn =
}
aRetSeg =
lCtr = 0;
sISAStream =
sIEAStream =
sISAStream = sLine;
sReturnMsg = sReturnMsg +
bEOF =
sFileName = aRetSeg[2];
sBodyStream =
sBodyStream = sBodyStream + sLine;
System.Text.
sTempLine = sTempLine +
sTempLine = sTempLine + sSegTerm;
sLine = sTempLine;
lCurChar = i + 1;
aRetAry[k] = sCurEle;
sCurEle =
k++;
sCurEle = sCurEle + sLine.Substring(j, 1);
j++;
//This Function Actually Creates The File...
sPayorDir = sPayorDir + sClaimType +
sPayorDir = sPayorDir +
bError =
writer.Write(sFileStream);
writer.Close();
Thanks for all your help in advance..
Chad