Skip to content

Instantly share code, notes, and snippets.

@MichaelChirico
MichaelChirico / fread_speed.R
Created February 23, 2018 03:50
script to install a given commit of data.table & run a speed test of fread
library(devtools)
install_github('Rdatatable/data.table', quiet = TRUE,
ref = commandArgs(trailingOnly = TRUE))
library(data.table)
f = list.files('.', recursive = TRUE, pattern = '\\.csv$', full.names = TRUE)
ts = replicate(5L, {
t0 = Sys.time()
invisible(lapply(f, fread))
as.double(Sys.time() - t0)
@gabceb
gabceb / ConvertXLS.ps1
Created May 3, 2011 22:36
Powershell script to convert all xls documents to xlsx in a folder recursively
$xlFixedFormat = [Microsoft.Office.Interop.Excel.XlFileFormat]::xlOpenXMLWorkbook
write-host $xlFixedFormat
$excel = New-Object -ComObject excel.application
$excel.visible = $true
$folderpath = "C:\Users\gabceb\Documents\testXLS"
$filetype ="*xls"
Get-ChildItem -Path $folderpath -Include $filetype -recurse |
ForEach-Object `
{
$path = ($_.fullname).substring(0, ($_.FullName).lastindexOf("."))