Im reading data from a speadsheet and moving into a notepad csv file, in c# and then back to a speadsheet. However in the spreadsheet some cell are empty (by empty i mean have a value of = ” “, just spaces and the number of spaces can vary). In the move over to notepad and back to spreadsheet these values can be lost. Is there a way to differentiate these cells so i can put quote marks around then so the cell is still present?
I have figured out that most of this empty cells have file types data_string or bool, this code works for all data_string
if (fileType == "data_string")
{
string see = cell.getFormula().ToString();
sw.Write("'" + see + "' ");
}
else
{
string see = cell.getFormula().ToString();
sw.Write(see + " ");
}
However i dont want all bool data to be in quote marks just the ones that are empty.so, so far i have
if (fileType == "bool")
{
if (cell.getFormula().Empty)
{
sw.Write("'" + cell.getFormula().ToString() + "' ");
}
}
However this doesnt work as really the cell is not empty, is there another way round this?
then ignore the fact that they are bool and just check whether the field is empty like: