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

Recommended Answers

All 2 Replies

tr '\n' ',' < file

Works Perfectly Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.