i have one column with data smith
john
michale
the o/p should be smith,john,michale how we do in unix
Answer Posted / srinivas
Buddies here is the correct answer assume file.txt is the input file then the command would be
cat file.txt | tr "\n" ","
what above command will do is on the input (which is 3 columns each having "\n" at the end) it will replace set1 ("\n" in this case) with set2 ("," in this case).
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
How to calculate the number of words in a file?
Is darwin unix?
What are positional parameters in unix?
What are shell variables?
What is necessary before running a shell script from the terminal?
Define a process group.
How to find out what processes are running in the background in unix?
How to display n-th line of a file in Unix?
What are the features and benefits of unix?
How is unix different from linux?
Differentiate relative path from an absolute path?
Is android unix like?
How does unix pipe work?
What is unix operating system and its features?
How do I find my unix os version?