Hi, The data for my new project are in a bunch of .sql files, instead of the clasic csv files that I'm used to work with. Could someone explain to me how to read these files into R? Thanks, -Ignacio [[alternative HTML version deleted]]
With so little information, one can only guess. I would guess your .sql files contain "scripts" written in the SQL language, in which case you will need some local database support to help you run those scripts in whatever database has the data. Perhaps the scripts will output csv files. If it turns out that you need "run" the SQL scripts from within R, then I'd suggest asking for help on R-sig-db. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 4/25/13 9:09 AM, "Ignacio Martinez" <ignacio82 at gmail.com> wrote:>Hi, > >The data for my new project are in a bunch of .sql files, instead of the >clasic csv files that I'm used to work with. > >Could someone explain to me how to read these files into R? > >Thanks, > >-Ignacio > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.
The format of files with a SQL extension are not necessarily well- defined. In most cases I have found, they are text files that contain SQL Data Definition Language statements (CREATE TABLE) and possibly Data Manipulation Language statements (INSERT INTO). You may be able to extract the portions of the files that contain data using read.csv and judicious use of the skip and nrow arguments, but you will have to first become familiar with the contents of the file using a text editor. If they are binary files, you may need to consult with the source of the data to identify the format used more precisely. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Ignacio Martinez <ignacio82 at gmail.com> wrote:>Hi, > >The data for my new project are in a bunch of .sql files, instead of >the >clasic csv files that I'm used to work with. > >Could someone explain to me how to read these files into R? > >Thanks, > >-Ignacio > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.