Combine CSV Files using C#

The simple script below shows how to combine csv files without duplicating headings using C#. This technique assumes that all of the files have the same structure, and that all of them contain a header row. using System.IO; using System.Linq; namespace CombineCsvFiles { class Program { static void Main(string[] args) { var sourceFolder = @"C:\csv_files"; var destinationFile = @"C:\csv_files\csv_files_combined.csv"; // Wildcard search returns files with 1-2 digit suffix string[] filePaths = Directory....

January 27, 2017 · Chris Koester

Select Columns from CSV Files with PowerShell

# ------------------------------------------------------------------------ # NAME: CSV_SelectColumns.ps1 # AUTHOR: Chris Koester # DATE: 11/2/2015 # # KEYWORDS: CSV, text, text file # # COMMENTS: This script is used to loop through all CSV files in a folder, # select the desired columns, then output the files to a separate folder. # # DIRECTIONS: Enter the source/destination folder paths and the # desired columns as variable values below. # # REFERENCES: # http://blogs.technet.com/b/heyscriptingguy/archive/2011/10/17/easily-remove-columns-from-a-csv-file-by-using-powershell.aspx # ------------------------------------------------------------------------ # Folder containing source CSV files....

December 8, 2015 · Chris Koester