示例#1
0
        public void parseCSV(string path, bool headerOnly, int numberOfHeaderLines)
        {
            try
            {
                using (StreamReader readFile = new StreamReader(path))
                {
                    csvFileHeader = new CSVFileHeader();
                    csvFileHeader.parseHeader(readFile, numberOfHeaderLines);

                    if (!headerOnly)
                    {
                        csvFileData = new CSVFileData();
                        csvFileData.parseData(readFile);
                    }
                }
            }
            catch (CSVFileException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new CSVFileException(e);
                //                    MessageBox.Show(e.Message);
            }
        }
示例#2
0
        public void parseCSV(string path,bool headerOnly,int numberOfHeaderLines)
        {
            try
            {
                using (StreamReader readFile = new StreamReader(path))
                {
                    csvFileHeader = new CSVFileHeader();
                    csvFileHeader.parseHeader(readFile, numberOfHeaderLines);

                    if (!headerOnly)
                    {
                        csvFileData = new CSVFileData();
                        csvFileData.parseData(readFile);
                    }

                }
            }
            catch (CSVFileException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new CSVFileException(e);
                //                    MessageBox.Show(e.Message);
            }
        }