Here is a possible solution to your problem using R.
DBI
package to connect with your database from R. You also need to install a package that supports your database (e.g., RPostgres
for PostgreSQL). For this example, I'll assume you're using PostgreSQL.54 chars3 lines
dbname
, user
, password
, host
, port
) with your database credentials.178 chars12 lines
your_table_name
with a name of your choice.162 chars12 lines
your_file_path
with the path to your file, and modify the parsing logic based on your file format.597 chars27 lines
cron
(Linux/Mac) or Task Scheduler
(Windows). Here is an example cron
entry to run the script at midnight every day:main.r41 chars2 lines
Replace /path/to/your/script.R
with the path to your R script. Make sure to make your script executable (chmod +x your/script.R
) and include the shebang (#!/usr/bin/env Rscript
) at the top of your script.
gistlibby LogSnag