如果满足条件,我想更新csv中的特定列。 例如
engineer,i
doctor,i
是csv文件,一旦访问该行,我想将“i”值更改为“v”
for(String line1 :lines)
{
String[] array1 = line1.split(",");
if(array1[1]=="v")
{
continue;
}
else
{
double distance = compute(array[0], array1[0]);
if(distance>0.8)
{
lines1.add(line1);
array1[1]="v"; //why this line doesnot update that column
}
}
}
那么如何更新或替换csv文件中的值???