Skip to content

Instantly share code, notes, and snippets.

View SuryaElite's full-sized avatar
👨‍💻

Surya SuryaElite

👨‍💻
View GitHub Profile
@SuryaElite
SuryaElite / merge_all_csv_to_large_one
Created October 13, 2014 12:03
Merge all the CSV to a Large CSV file in a Folder.
# This program will merge all the csv files to a single large file. Headers should be same.
# sampleFile.csv = Provide a file that contains the header of csv.
{ head -n1 sampleFile.csv; for f in *.csv; do tail -n+2 "$f"; done; } > largeFile.csv
@SuryaElite
SuryaElite / Convert XLSX or XLS file to Array in PHP
Created September 9, 2014 15:53
Convert XLSX or XLS file to Array in PHP
<?php
function convertXLStoArray($infile, $outfile){
if(!file_exists($infile) || !is_readable($infile) || !file_exists($outfile) || !is_readable($outfile))
return FALSE;
$fileType = PHPExcel_IOFactory::identify($infile);
$objReader = PHPExcel_IOFactory::createReader($fileType);