コード例 #1
0
        public int Get_Number_Of_Lines(String InputFile)
        {
            CsvUtils cu = new CsvUtils();

            cu.SetFile(InputFile);

            return(cu.Get_Number_Of_Lines());
        }
コード例 #2
0
        // Change the content of a Cell
        public String Set_Cell_Content(String InputFile, String ColumnName, int LineNumber, String NewValue)
        {
            CsvUtils cu = new CsvUtils();

            cu.SetFile(InputFile);
            int NbOfLines = cu.Get_Number_Of_Lines();

            if (LineNumber > NbOfLines)
            {
                return("Line Number exceeds the number of total lines in the input file.");
            }

            int ColIdx = cu.Get_Column_Index(ColumnName);

            if (ColIdx < 0)
            {
                return("Column Does Not Exist.");
            }

            cu.Set_Cell_Content(ColumnName, LineNumber, NewValue);
            cu.Save_File_As_CSV(InputFile);
            return("");
        }