csv与txt文件 [英] csv versus txt file

查看:123
本文介绍了csv与txt文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个小工具来检查两个系统上的数据一致性。


作为输入,我有两个文件 - 都是通过以.csv格式导出数据生成的。 / p>

我将这些文件打开为Scripting.FileSystemObject并在另一行之后读取一行。


但.csv格式似乎包含大量垃圾我无法阅读它(=我无法阅读我的文字内容)。看起来你是一个隐藏在csv文件中所有可见字符之间的空白字符。


如果我"全部选择"在csv文件中并将其粘贴到记事本中并另存为txt文件 - 该文件的大小是原始csv文件的一半,我可以按照预期的方式阅读我的程序内容。


任何想法为什么会这样......?


我能设置什么来读取csv文件作为普通的文本文件?

解决方案


我的猜测是它必须与任何主机有关您正在使用的程序将数据导出为CSV文件。我怀疑并非所有程序都生成相同的CSV输出。


只需我2美分......




I am writing a small tool to check data consistency on two systems.

As input I have two files - both generated by exporting data in a .csv format.

I open the files as Scripting.FileSystemObject and read one line after the other.

But the .csv format seems to contain a lot of rubbish and I have trouble reading it (=I cant read the contents of my lines). It seems like thee is a blank character somehow hidden between all the visible characters in the csv-file.

If I "select all" in the csv file and paste it into notepad and save as a txt file - the file has half the size of the original csv-file, and I can read the content with my program as intended.

Any idea why that is so...?

Anything I can set to read the csv-file as a plain text file?

解决方案

Hi,

My guess is that it must have something to do with whatever host program you're using to export the data into a CSV file. I suspect that not all programs produce the same CSV output.

Just my 2 cents...



这篇关于csv与txt文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆