Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }