Altair slc language3 proc r read write csv files and summarize and looping with sqlite
Note: SQLite has CSV read and write commands; however, I want to handle general text file processing in SQL.
Keep in mind that I am demonstrating the exact sqlite queries in 9 languages below.
In addition, you can use the exact same queries on any ODBC-compliant language or operating system.
Too long to post on a list, see github
https://github.com/rogerjdeangelis/utl-altair-slc-language3-proc-r-read-write-csv-files-and-summarize-and-looping-with-sqlite
related repos (see for information of installing odbc and sqlite)
https://github.com/rogerjdeangelis/utl-altair-slc-sqlite-cheat-sheet
https://github.com/rogerjdeangelis/utl-altair-slc-language1-drop-down-to-open-source-spss-and-execute-postgresql-query
https://github.com/rogerjdeangelis/utl-altair-slc-language2-drop-down-to-open-source-matlab-and-execute-sqlite-with-extensions
PROBLEM
PROCESS
1 slc create sqlite table 'have' with 3 lines (sentences) and column name line
d:/sqlite/mysqlite.db table have
line
This is the 1st line
This is the 2nd line
This is the 3rd line
2 r summarize sqlite table
select sex avg(age) avg(height) from have group by sex
3 r convert sqlite table 'have' to a text file using sqlite 'writefile' command
d:/txt/have.txt
This is the 1st line
This is the 2nd line
This is the 3rd line
4 r convert text file 'd:/txt/have.txt' to r dataframe using sqlite readfile
text
This is the 1st line
This is the 2nd line
This is the 3rd line
5 iterate(loop) over numbers 1-10 and output median (5.5)