0

I have a sql query in a txt file and I want to read it into a variable so I do:

q<- readLines("sql.txt")

but that does not work. It just returns "yp" and then blanks when the actual .txt file contains

"select * from myTable" etc...

how can I use readLines to read the lines of the txt file?

Rich Scriven
  • 93,629
  • 10
  • 165
  • 233
user3022875
  • 8,018
  • 24
  • 93
  • 158
  • Are you sure you are reading the right file? Your description of the problem doesn't make much sense. If would help if you could make your problem [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – MrFlick Nov 26 '14 at 18:55
  • Are you absolutely sure the file contains what you think it contains? – Rich Scriven Nov 26 '14 at 18:55
  • What about this solution: http://stackoverflow.com/questions/9068397/import-text-file-as-single-character-string – robert Nov 26 '14 at 18:57

0 Answers0