Import multiline SQL query to single string
问题 In R, how can I import the contents of a multiline text file (containing SQL) to a single string? The sql.txt file looks like this: SELECT TOP 100 setpoint, tph FROM rates I need to import that text file into an R string such that it looks like this: > sqlString [1] "SELECT TOP 100 setpoint, tph FROM rates" That's so that I can feed it to the RODBC like this > library(RODBC) > myconn<-odbcConnect("RPM") > results<-sqlQuery(myconn,sqlString) I've tried the readLines command as follows but it