如何将制表符分隔的文件转换为逗号分隔的文件? [英] How to convert a tab-separated file into a comma-separated file?

查看:593
本文介绍了如何将制表符分隔的文件转换为逗号分隔的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将制表符分隔的文件转换为CSV文件.谁能帮我吗?

I want to convert a tab-separated file into a CSV file. Can anyone help me?

推荐答案

OSX的答案是不同的.

The answer for OSX is different.

MacOS无法理解sed表达式中的\t.

MacOS does not understand \t in the sed expression.

您必须使用 ctrl + v 然后 tab 将制表符文字插入sed搜索模式(请参见

You have to insert the tab literal into the sed search pattern by using ctrl+v then tab (see How can I insert a tab character with sed on OS X?)

sed 's/ /,/g' input_file > output_file

这篇关于如何将制表符分隔的文件转换为逗号分隔的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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