fgetcsv Questions
7
Solved
I try to read a CSV and echo the content. But the content displays the characters wrong.
Mäx Müstermänn -> Mäx Müstermänn
Encoding of the CSV file is UTF-8 without BOM (checked with Notepad++...
8
Solved
I want to delete the BOM from my imported file, but it just doesn't seem to work.
I tried to preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $file); and a str_replace.
I hope anybody sees what I'm doi...
9
Solved
I am trying to import a CSV file. Due to the program we use, the first row is basically all headers that I would like to skip since I've already put my own headers in via HTML. How can I get the co...
6
Solved
I have a line like this in my CSV:
"Samsung U600 24"","10000003409","1","10000003427"
Quote next to 24 is used to express inches, while the quote just next to that quote closes the field. I'm rea...
5
Solved
I have .csv file with 4 columns. What's the easiest way to remove a line identical with the id of the first column? Here's where I got stuck:
if($_GET['id']) {
$id = $_GET['id'];
$file_handle = ...
3
Solved
I have a script which parses the CSV file and start verifying the emails. this works fine for 1000 lines. but on 15 million lines it shows memory exhausted error. the file size is 400MB. any sugges...
3
Solved
I am trying to read a certain data in my csv file and transfer it to an array. What I want is to get all the data of a certain column but I want to start on a certain row (let say for example, row ...
3
Solved
I have this script that I did, it basically grabs all the files in my "logs" folder and merge them all in one array file, my only problem is that, sometimes the script breaks if there is blank line...
2
I have a very curious issue whith fgtcsv(). Look at this code
$csv_check = fopen(CSV_DIR.$this->db_table.".csv","r");
$data = fgetcsv($csv_check, 1000, $this->fields_terminated_by);
fclos...
Rialto asked 23/4, 2015 at 15:51
6
Solved
here is my csv
column1,column2,column3,column4,column5
column1_row1,column2_row1,column3_row1,column4_row1,column5_row1
column1_row2,column2_row2,column3_row2,column4_row2,column5_row2
column1_row...
3
I have a CSV file where the first "cell" is just an int, 9, in this case. The next line is 10 for the first "cell" and so on. When I do $array = fgetcsv($file); the first cell of the first line has...
Lag asked 21/11, 2013 at 15:12
3
Solved
i have a code.
on localhost i have not problem with reading csv file (with Unicode chars). but when upload code on host output is nothing. why? what is solution?
while (($data=fgetcsv($fin,5000,"...
5
Solved
There seems to be an encoding issue or bug in PHP with fputcsv() and fgetcsv().
The following PHP code:
$row_before = ['A', json_encode(['a', '\\', 'b']), 'B'];
print "\nBEFORE:\n";
var_export($...
6
Solved
I have the following csv file:
upc/ean/isbn,item name,category,supplier id,cost price,unit price,tax 1 name,tax 1 percent,tax 2 name,tax 2 percent,quantity,reorder level,description,allow alt. des...
6
Solved
Suppose I have a .csv file with the following content:
"text, with commas","another text",123,"text",5;
"some without commas","another text",123,"text";
"some text with commas or no",,12...
2
UPDATE 4:
I've found (as suspected) that the files enconding is responsible for this. I converted the csv file from UCS-2 Little Endian to UTF-8 and everything works fine. Anyway I need to find so...
3
Solved
I'm trying to determine how many columns a csv file has.
Here's my script, which is only utilizing the first column, but I'm running slightly blind. I want to place a variable that limits the colu...
2
I was parsing a csv file using php with fgetcsv function. It parsed all content in a line, later i found, csv contains carraige return as "\r". I saw - it was reported as php bug before. I've solve...
3
Solved
I have this array with airport codes and city names (around 3500 lines).
code,city
"Abilene, TX ",ABI
"Adak Island, AK ",ADK
"Akiachak, AK ",KKI
"Akiak, AK ",AKI
"Akron/Canton, OH ",CAK
"Akuton, A...
3
Solved
I have a csv file with 3 columns: email address, first name and last name. I have got the stage where I can print out the array using the following code:
<?php
$file = fopen("testEmails.csv","r...
2
Solved
I'm trying to use fgetCsv but for some reason it is only reading the first line. Here is the code:
$fieldseparator = ",";
$lineseparator = "\r";
if(!file_exists($csvFile)) {
echo "<div id='e...
3
Solved
Using fgetcsv, can I somehow do a destructive read where rows I've read and processed would be discarded so if I don't make it through the whole file in the first pass, I can come back and pick up ...
2
Solved
I'm building a simple shop system which takes its products from an array generated by a csv file.
My csv is as following:
pid;name;color
11149;Miro;"schwarz;weiß;blau;rot;gelb"
11004;FritzHansen;...
Laius asked 27/3, 2013 at 13:20
2
I'm looking for a very fast method to read a csv file. My data structure looks like this:
timestamp ,float , string ,ip ,string
1318190061,1640851625, lore ipsum,84.169.42.48,appname
and I'm us...
Court asked 9/10, 2011 at 21:1
2
Solved
Is it possible to make curl, access a url and the result as a file resource? like how fopen does it.
My goals:
Parse a CSV file
Pass it to fgetcsv
My obstruction: fopen is disabled
My chunk o...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.