Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个在 Unix 环境中创建的文本文件。现在我想在 java 中但在 Windows 环境中处理这个文件。那么无论如何我可以摆脱换行符的问题,因为 Unix 换行十六进制代码是“0A”,但在 Windows 中它是“0D”和“0A”(回车和换行)。
注意:我不建议文件创建者更改它。所以我必须找到解决方案。
有很多方法可以将文件转换为 windows 格式。在让 java 程序处理它之前先转换它。
如何在 Unix 和 Windows 文本文件之间进行转换:
http://kb.iu.edu/data/acux.html