Hii All ,
i have a text file contains numbers with the following format , how can i read this numbers to apply math operations on
6666 tab 6666 tab 6666
6666 tab 6666 tab 6666
6666 tab 6666 tab 6666
6666 tab 6666 tab 6666
how to neglect this tab ? and put each 4 digits into avariable ?
then i'll send this varables each one into a cell in Excel
i have a text file contains numbers with the following format , how can i read this numbers to apply math operations on
6666 tab 6666 tab 6666
6666 tab 6666 tab 6666
6666 tab 6666 tab 6666
6666 tab 6666 tab 6666
how to neglect this tab ? and put each 4 digits into avariable ?
then i'll send this varables each one into a cell in Excel
Graham ShoreyPosted Dec 12, 2006, 10:03 AM
That's how.
M FaragPosted Dec 12, 2006, 8:55 AM
M FaragPosted Dec 12, 2006, 8:49 AM
Graham ShoreyPosted Dec 11, 2006, 9:01 AM
You can use the following to split each line of your file into an array
string line;
string[] list;
TextReader tr = new StreamReader(YourFile);
while ((line = tr.ReadLine()) != null)
{
list = line.Split(new char[] {'\t'});
foreach (string line in list)
{
//do stuff with array
}
}
Why would you need your program to output this file to excel when it's already in a format that excel can read?