c# - ReadLine() vs Read() to Get CR and LF Efficiently? -
To set the line length of each line in many large text files with 100,000+ rows before importing, Using an SSIS package working on the program I will also check other values in each line to verify that they are right to import into their database using SSIS. For example, I'm looking for a line length of 3,000 characters and a CR in 3001 and LF in 3002, so there are a total of 3002 characters in total.
When using ReadLine () it reads a CR or LF as the end of the line so that I can not check CR or LF characters. To determine whether the length is fine or not, I was just checking the line length of 3000. I just had to face an issue where the file 3001 had an LF in the situation but lost the CR. So readline () says that this 3000 Charlie Witch is correct, but it will fail in my SSIS package because it is missing a CR.
I've verified that once each character will reach 1, I can determine whether each row has a CR and LF but it looks unproductive, and when faced with some files If it does, then it is very disabled above the limit of 5000000 above. I will then need to add each letter to the string or use the Reebok () and convert a four array into a string so that I can see other values in the line.
Do anyone have any ideas to check the line for CR and LF and without damaging unnecessary resources and without ending in a relatively timely way, other values on a given line How to check
has verified that read () will reach 1 character at once and I can determine if each line has a CR and LF but it seems unproductive
Think about this: do you think that
readLine () Is there a magic wand and do not need to read every character?
Just create your own read-miles line () Some have to read the letters, it does not matter if it's your code or Lib is I / O will be buffer by stream and Windows.
Comments
Post a Comment