Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How to calculate the number of words in a file?

1021


Is darwin unix?

998


What are positional parameters in unix?

1083


What are shell variables?

982


What is necessary before running a shell script from the terminal?

1016


Define a process group.

966


How to find out what processes are running in the background in unix?

1019


How to display n-th line of a file in Unix?

1046


What are the features and benefits of unix?

983


How is unix different from linux?

1108


Differentiate relative path from an absolute path?

967


Is android unix like?

1014


How does unix pipe work?

1015


What is unix operating system and its features?

984


How do I find my unix os version?

991