用单词替换空白列
替换该空白
我有一个文本文件,其中一些记录是空白的,我想用单词 N/A 或空前
field-A field-b field-c field-d field-e field-f field-g field-h field-i 1 2 3 4 5 6 7 8 9 1 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 1 4 5 6 7 8 9
结果
field-A field-b field-c field-d field-e field-f field-g field-h field-i 1 2 3 4 5 6 7 8 9 1 N/A 3 4 5 6 7 8 9 N/A 2 3 4 5 6 7 8 9 1 N/A N/A 4 5 6 7 8 9
I have a text file some of the record is blank and I want replace that blank space with the word N/A or null
ex-
field-A field-b field-c field-d field-e field-f field-g field-h field-i 1 2 3 4 5 6 7 8 9 1 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 1 4 5 6 7 8 9
result expect
field-A field-b field-c field-d field-e field-f field-g field-h field-i 1 2 3 4 5 6 7 8 9 1 N/A 3 4 5 6 7 8 9 N/A 2 3 4 5 6 7 8 9 1 N/A N/A 4 5 6 7 8 9
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
产生
produces
如果它是空格字符,我会查找字符代码或空格。
在 C# 中,假设您的变量是
mystr
,则类似于:myStr = myStr.Replace(" ", "N/A");
您还可以查找该字符值,具体取决于您使用的语言。
If it's a space character I'd look for the character code or a blank space.
In C# assuming your variable was
mystr
it would be something like:myStr = myStr.Replace(" ", "N/A");
You can also look for the character value, depending on the language you're using.