[root@node1 ~]# cat tableName.txt
hello
hadoop
spark
mapreduce
storm
python
[root@node1 ~]#
要达到的效果
hello,hadoop,spark,mapreduce,storm,python
[root@node1 ~]# echo `(cat tableName.txt)` | sed 's/ /,/g'
hello,hadoop,spark,mapreduce,storm,python
[root@node1 ~]#
echo `(cat tableName.txt)` | sed 's/ /,/g'
网友评论