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

Is unix free?

518


What is inode in unix operating system?

518


i m putting 2.6yrs fake exp in oracle/unix production support i want to know some real time issues,like tell me the challenging issue u ever faced? my project is credit card application plz help me!

12743


What is architecture of unix operating system?

493


Where unix is used today?

511






What is ‘the principle of locality’?

568


What is unix language?

511


What scheme does the Kernel in Unix System V follow while choosing a swap device among the multiple swap devices?

538


What is home directory in unix?

481


What is a directory?

549


What is unix kernel?

480


What is unix shell scripting used for?

487


Explain how and when a DNS request is solved when a user tries to surf to the site www.abcdeg.in .Assume the user machine uses a local name server and sits on another network other than www.abcdef.in.

4358


What is unix structure?

507


Is it possible to count number char, line in a file; if so, How?

724