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


Please Help Members By Posting Answers For Below Questions

What is the difference between an absolute path and a relative path in unix?

546


Explain the term filter.

535


What is delayed write in unix?

501


Describe the responsibilities of shell in brief.

501


Does windows use unix?

497






What is inode in unix operating system?

523


What is a shell?

535


What does shebang mean in unix?

505


How to get the nth word of a line in Unix?

585


What is the core of unix operating system?

513


What is the symbol in unix?

508


Explain a path in unix.

512


What are the main features of unix?

497


What is the use of grep and egrep in unix?

504


What are conditions for a machine to support Demand Paging?

544