Hi,
I'm new here and to c# and have been looking for some help
for days.
Here's what I'm trying to do:
I have a process running on a remote computer that dumps
some report
information into a txt file. This computer is remote via
DUN, so I
have a poller that grabs that file and dumps it locally. I
am trying
to write a console app to read that file and make it fancy
in excel
(charts, etc.).
Here's the basic format of the file:
REPORT TYPE1
COL1 COL2
11 TYPEA
33 TYPEB
44 TYPEB
REPORT TYPE2
COL1 COL2
492 COMPLETE
300 INCOMPLETE
REPORT TYPE3
COL1 COL2
1 500
2 300
3 200
4 150
5 100
6 100
7 100
8 100
9 100
10 100
The problem I'm having is that the different report types
may have
more or less values. What I've done so far is this:
TextReader tr = new
StreamReader(report.FullName);
while (tr.Peek() > -1)
{
read = (tr.ReadLine());
Array Line = read.Split(new char[] {
't' });
foreach (string value in Line)
{
if (value != "")
{
report[row, col] = value;
}
else
{
//pass report array to
excel
}
col += 1;
}
row += 1;
col = 0;
}
I'd like to be able to define a 2d dynamic array, fill it as
needed,
then pass it to my write to excel function. The only way I
can think
to do this is to fill a static array (there is a max
length(300) and
max width(4) of the text file), then write a separate
function to read
the static array and copy out the individual reports to
another static
array and pass the second array to the write to excel
function.
This sounds overly complicated as in vbscript I could just
ReDim the
array to a larger size as needed. I've looked at arraylist,
but
apparently it's only for one dimensional arrays. Any ideas
or
suggestions would be greatly appreciated!!
-scott
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharp googlegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribe googlegroups.com
For more options, visit this group at http://g
roups.google.com/group/C_Sharp?hl=en
-~----------~----~----~----~------~----~------~--~---
|