Skip to content
Advertisement

Tag: csv

replace html5 upload function with hardcoded path

I’m trying to use a script to display a .csv file and make content filter and searchable. I found this script on github: I want to put this script on my webserver (apache). That works great, however, I want it to work with 1 or more .csv files that resides on the same folder. My goal is that when the

Finding duplicate column values in a CSV

I’m importing a CSV that has 3 columns, one of these columns could have duplicate records. I have 2 things to check: So far, I’m parsing the CSV file, once and checking that 1. (NAME is valid), which if it fails, it simply breaks out of the while loop and stops. I guess the question is, how I’d check that

Extract datas with ‘,’ from database to csv file

This is my code to extract datas from database to csv file. It’s working fine but now that I put it in my program where the datas have addresses, thus having commas ( , ), I’m having problem in printing it. This is how it looks like: It should be like this: The City and email are pushed to the

fputcsv display leading zeros

I’m using a PHP script to generate an excel CSV file from a result-set query. All works fine but when I read my excel file, I can not display leading zeros. This is my code: If I make a var_dump() of $finalData[] I see the correct value, for example ‘000198’, ‘000199’, ‘000200’ but the same value in my XLS file

Keep leading zeros with fgetcsv in PHP

I’m reading a .csv file (I have no control of the format of the file) and I’m trying to keep the leading zeros for the data in the resulting array. For instance, the .csv file has “0615” in …

Problem with COPY FROM with PHP in postgresql

I have some big .csv files and I am trying to put it into database. I am using this construction: But after use i function in CLI I got that: This is not a problem with end marker, but with encoding. If I open this file in VIM and will save it again, everything is OK, but without this operations

Advertisement