Reading through lines of text file sequencially

Reply

Join Date: Jun 2007
Posts: 7
Reputation: slbit is an unknown quantity at this point 
Solved Threads: 0
slbit slbit is offline Offline
Newbie Poster

Reading through lines of text file sequencially

 
0
  #1
Jun 11th, 2007
I have a text file with hundreds of names i would like to search in the database, yet to perform this query the names have to be on one line separated by commas. the text file is as follows

Mike
Ralph
Cindy
Claire
John

the output i need is

Mike,Ralph,Cindy,Claire,John

Any help on scripting this ?

Thanks
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 148
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Reading through lines of text file sequencially

 
0
  #2
Jun 11th, 2007
Shell Scripting Syntax (Toggle Plain Text)
  1. tr '\n' ',' < file
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 7
Reputation: slbit is an unknown quantity at this point 
Solved Threads: 0
slbit slbit is offline Offline
Newbie Poster

Re: Reading through lines of text file sequencially

 
0
  #3
Jun 12th, 2007
Works Perfectly Thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC