Tag Archives: csv

Adding BOM to CSV file using fputcsv

Questions: I have a simple CSV file being generated that includes foreign characters. I’ve noted that if I don’t include a Byte Order Mark that the foreign characters aren’t appearing properly in Excel (but they appear fine when a BOM is present). How can I add a BOM to the beginning of the file when… Read More »

Merge many CSV files

Questions: I have set of 500 csv files. Each file has four columns and variable number of rows. I want to merge all of these csv’s into one common sheet. If someone can help me in doing this in PowerShell, it would be great. Sample Data in Excel 1: Name Age Marks Class A 15… Read More »

CSV date format

Questions: I have a VB application which extracts data and creates 3 CSV files (a.csv, b.csv, c.csv). Then I use another Excel spreadsheet (import.xls) to import all the data from the above CSV files into this sheet. import.xls file has a macro which opens the CSV files one by one and copies the data. The… Read More »

Convert SQL result set to CSV file

Questions: I’m working in C# and need making use of Entity Framework 6. I have a service that calls a stored procedure (using the Dbcontext) and places the results in an IList. I then have a controller that makes use of this service. Now originally I was using the results combined with Epplus to save… Read More »

PHP to MySql to CSV to Excel UTF-8

Questions: I know this has been discussed several times but yet I’m getting crazy dealing with this problem. I have a form with a submit.php action. At first I didn’t change anything about the charsets, I didn’t use any utf8 header information.. The result was that I could read all the ä,ö,ü etc correctly inside… Read More »

Upload a .csv file into PHP MySQL database without column headings

Questions: I want to upload .csv files into MySQL database using PHP. I have this code: <?php include_once ‘db.php’; if(isset($_POST[‘submit’])){ if($_FILES[‘csv_data’][‘name’]){ $arrFileName = explode(‘.’,$_FILES[‘csv_data’][‘name’]); if($arrFileName[1] == ‘csv’){ $handle = fopen($_FILES[‘csv_data’][‘tmp_name’], “r”); while (($data = fgetcsv($handle, 1000, “,”)) !== FALSE) { $item1 = mysqli_real_escape_string($dbConnection,$data[0]); $item2 = mysqli_real_escape_string($dbConnection,$data[1]); $import=”INSERT into tbl_csv values(”,’$item1′,’$item2′)”; mysqli_query($dbConnection,$import); } fclose($handle); print “Import… Read More »

Downloading zip file from website using excel vba (if also able to extract the csv from zip file and open it in excel, then even better)

Questions: after quite some searching I’ve not been able to make a macro that would download a .zip file from a specific website. I mean I’ve been able to find similar problems but have not been able to apply the changes necessary in order for my problem to be solved. The website that contains the… Read More »