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

Answers were Sorted based on User's Feedback



i have one column with data smith john mic..

Answer / madhusudhanan.s

Inside a file save 3 names column wise
then type the below command

tr "\n" "," < <filename>

Is This Answer Correct ?    22 Yes 7 No

i have one column with data smith john mic..

Answer / 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

i have one column with data smith john mic..

Answer / narendra chenna

cat <filename with data> | while read filename
do
tem=$filename" "$filename
echo $tem >><onther file name>
done

Is This Answer Correct ?    2 Yes 1 No

i have one column with data smith john mic..

Answer / b k roy

Suppose they are asking for displaying just one of the
columns in a directory, make a note of that column number
as it appears when we do a ls -lrt. Then we can use awk to
just display the one columns as o/p.

If column number is n, then do this:

ls -lrt | awk '{print $n}'

Is This Answer Correct ?    1 Yes 0 No

i have one column with data smith john mic..

Answer / david

file1 contain the data like ....
john smith michael


so
cat file1 |tr ' ' ','
or
cat file1 |sed 's/ /,/g'



this will really help you dear ....

Is This Answer Correct ?    0 Yes 1 No

i have one column with data smith john mic..

Answer / supriya

save the names in the file in column wise,then give the
command as:
tr "\n" "," <filename>

Is This Answer Correct ?    7 Yes 9 No

Post New Answer

More Unix General Interview Questions

How do I search for a file in unix?

0 Answers  


What are conditions for a machine to support Demand Paging?

0 Answers  


Is unix free?

0 Answers  


What are the main features of unix operating system?

0 Answers  


What are unix options?

0 Answers  


How would you identify daemons in unix?

0 Answers  


How to find a file in unix?

0 Answers  


Define the term directory?

0 Answers  


What are positional parameters in unix?

0 Answers  


Is mac terminal unix?

0 Answers  


What is the use of -l when listing a directory?

0 Answers  


Explain kernal and shell?

0 Answers  


Categories