| | |
Reading through lines of text file sequencially
![]() |
•
•
Join Date: Jun 2007
Posts: 7
Reputation:
Solved Threads: 0
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
Mike
Ralph
Cindy
Claire
John
the output i need is
Mike,Ralph,Cindy,Claire,John
Any help on scripting this ?
Thanks
•
•
Join Date: Apr 2006
Posts: 148
Reputation:
Solved Threads: 40
Shell Scripting Syntax (Toggle Plain Text)
tr '\n' ',' < file
![]() |
Similar Threads
- C++ Reading from a text file (C++)
- Help Please, how do i read from text file into array? (Visual Basic 4 / 5 / 6)
- how to remove a number of lines from a text file ? (Python)
- Replace text in a file (Shell Scripting)
- # of lines in a text file (Java)
- how do i read the last line of a text file? (Python)
- help on using StringTokenizer to read and compute multiple lines from text (Java)
Other Threads in the Shell Scripting Forum
- Previous Thread: Concat files with similar names in different directories
- Next Thread: Script to compare dates?
| Thread Tools | Search this Thread |





