Skip to content

Instantly share code, notes, and snippets.

View adtraub's full-sized avatar

Adam adtraub

  • Fairplay Technologies LLC
View GitHub Profile
@adtraub
adtraub / SQL Server Powershell
Last active October 14, 2016 13:14
Two powershell functions for running SQL. The first runs a single file, the second runs all files within a directory.
#Runs A SQL Script
Function runSQLScript {
param(
[string]$db, # the sql db to use
[string]$script, #the script to use
[string]$outLog,
[string]$errLog
)
if($db){#The things I do for pretty output...
@adtraub
adtraub / removeNewLines.py
Last active September 13, 2016 12:28
Simple Python Script to remove new lines from a file and save the output to a new file - not meant to be particularly robust
def removeNewLines(inputFileName, outputFileName):
with open(outputFileName, 'w') as outFile:
with open(inputFileName, 'r') as inFile:
outFile.write(inFile.read().replace('\n', ''))
if __name__ == "__main__":
inputFileName = input("input file name: ")
outputFileName = input("output file name: ")
removeNewLines(inputFileName, outputFileName)