I use EMX, I have a excel file (see picture 1) and the excel file is saved in the USB Stick.
I define 4 double/bool array as follow:
public static bool[] P_RW = new bool[1000];
public static double[] P_Min = new double[1000];
public static double[] P_Max = new double[1000];
public static double[] P_Voreinstellung= new double[1000];
How can I read the content of “column C(D,E,F)” one for one to array P_RW(P_Min,P_Max,P_Voreinstellung)?
I mean I want to initialize the 4 arrays with a excel file in the USB Stick.
I have written somecodes for writing and reading some simple text into/from a file
something like as follow:
StreamWriter textFile = new StreamWriter(Parameter.USBCardRootDirectory + @ "\hello.txt");
textFile.WriteLine("Hello USB card");
or
FileStream fHandle = new FileStream(path, FileMode.Open, FileAccess.Read);
byte[] data = new byte[fHandle.Length];
fHandle.Read(data, 0, data.Length);
fHandle.Close();
I have used the library “System.IO.StreamWriter” and “System.IO.FileStream”
Does the library have the function for serching a position in a excel file and read the content of Square one by one and save them one by one to a array?
I agree with Architect.
The newer versions of excel files are really a “zip” file with several xml files embedded. One could extract the xml file that contains the data and then parse that.