How to replace all white space with comma in a text file
Linux 0
(0)
for example, i have a text file like below
test1 test2
test3 test4
test5 test6
i want my text file to look like as below
test1,test2
test3,test4
test5,test6
use below sed function to achieve the result.
sed -e 's/\s+/,/g' old file > new file
How useful was this post?
Click on a star to rate it!
Average rating 0 / 5. Vote count: 0
No votes so far! Be the first to rate this post.