I want to make the csv more readable so I want to replace the special character " in csv and split it by using , and here is my code:
for(int i = 1; i < 10200; i++)
{
string valueBefore = specialSheet.Cells[i, 1].Value;
List<string> valueAfter= new List<string>(valueBefore.Replace("\"", ""));
for(int j = 1; j < 28; j++)
{
specialSheet.Cells[i, j].Value = valueAfter[j];
}
}
The csv before my code:
""""a, b, c, d, e, f, g"""" | ||
""""h, i, j, k, l, m, n"""" |
The csv after my code (this is what i want):
a | b | c | d | e | f | g |
h | i | j | k | l | m | n |
but now i receive an error:
CS1503 Argument 1: cannot convert from 'string' to 'int'
Can anyone help to see if there are any error in my code? Thanks.