diff --git a/src/php/wp-cli/utils.php b/src/php/wp-cli/utils.php
index <HASH>..<HASH> 100644
--- a/src/php/wp-cli/utils.php
+++ b/src/php/wp-cli/utils.php
@@ -156,3 +156,26 @@ function get_upgrader( $class ) {
 	return new $class( new \CLI_Upgrader_Skin );
 }
 
+function parse_csv( $filepath, $has_headers = true ) {
+
+	if ( false == ( $csv = fopen( $filepath, 'r' ) ) )
+		\WP_CLI::error( sprintf( 'Could not open csv file: %s', $filepath ) );
+
+	$parsed_data = array();
+	$headers = array();
+	while ( ( $row = fgetcsv( $csv, 10000, "," ) ) !== FALSE ) {
+		if ( $has_headers ) {
+			$headers = array_values( $row );
+			$has_headers = false;
+			continue;
+		}
+		$row_data = array();
+		foreach( $row as $index => $cell_value ) {
+			if ( ! empty( $headers[$index] ) )
+				$index = $headers[$index];
+			$row_data[$index] = $cell_value;
+		}
+		$parsed_data[] = $row_data;
+	}
+	return $parsed_data;
+}
A utility method for parsing a given CSV