Esempio n. 1
0
        /******************************************************************************************
        STATIC METHODS
        ******************************************************************************************/
        public static void WriteFullFile(string p_filePath, List<string> p_lines)
        {
            TextRight righter = new TextRight(p_filePath, false);

            foreach (string line in p_lines)
            {
                righter.WriteText(line);
            }

            righter.CloseRighter();
        }
Esempio n. 2
0
        public static void WriteTableToCSV(DataTable p_table, string p_filePath)
        {
            TextRight writer = new TextRight(p_filePath, false);

            string currLine = "";

            // write the column names

            int numCols = p_table.Columns.Count;

            for (int c = 0; c < numCols - 1; c++)
                currLine += p_table.Columns[c].ColumnName + ",";

            currLine += p_table.Columns[numCols - 1].ColumnName;

            writer.WriteText(currLine);

            // write the data of each row

            System.Data.DataRow currRow;

            for (int r = 0; r < p_table.Rows.Count; r++)
            {
                currRow = p_table.Rows[r];
                currLine = "";

                for (int c = 0; c < numCols - 1; c++)
                    currLine += currRow[c].ToString() + ",";

                currLine += currRow[numCols - 1].ToString();

                writer.WriteText(currLine);
            }

            writer.CloseRighter();
        }