本文介绍了我只想更新CSV文件中现有行的1列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个移动应用程序,通过该应用程序,我只需要更新qty列.
也就是说,如果扫描了条形码,则它将在.csv文件中进行搜索;如果条形码中不存在文件,则它将更新整个行,如下所示
Hi Everyone,
I have one mobile application through which i need to update the qty column only.
That is if a barcode is scanned then it will search in .csv file, if the barcode is not present in file then it will update the entire row as below
Dim sr As StreamWriter = File.AppendText("\Application\" & createHfile)
quantity = quantity + 1
mWriteData = "" & Now.Date & "," & dr(1) & "," & quantity & ""
sr.WriteLine(mWriteData)
sr.Close()
txtserialno.Text = ""
但是如果再次扫描相同的条形码,则它已经存在于.csv文件中,因此在这里我需要将数量从"1"更新为"2",而不是插入新行.
在此先感谢
But if the same barcode is scanned again then it is already present in .csv file, so here i need to update the quantity from ''1'' to ''2'' instead of inserting the new row.
Thanks in advance
推荐答案
这篇关于我只想更新CSV文件中现有行的1列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!