954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Reading through lines of text file sequencially

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

slbit
Newbie Poster
7 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 
tr '\n' ',' < file
ghostdog74
Junior Poster
156 posts since Apr 2006
Reputation Points: 75
Solved Threads: 44
 

Works Perfectly Thanks

slbit
Newbie Poster
7 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You