• Register

Recent questions tagged csv

0 votes
1 answer 18 views
Problem: I'm trying to write a program that looks at a .CSV file (input.csv) and rewrites only the rows that begin with a certain element (corrected.csv), as listed in a text file (output.txt). This is what my program looks like right now: import csv lines = [] ... reader: if row[0] not in lines: writer.writerow(row) Unfortunately, I keep getting this error, and I have no clue what it's about.
asked Feb 19 Mashhoodch 9.1k points
0 votes
1 answer 9 views
Problem: attributeerror: 'dataframe' object has no attribute 'data'
asked Feb 18 charles mathews 3.8k points
0 votes
1 answer 10 views
how to read csv file in matlab
asked Jan 25 waji 1.9k points
0 votes
1 answer 24 views
Problem: I am a beginner to python and am at the moment having trouble using the command line. I have a script test.py (which only contains print("Hello.")), and it is located in the map C:\Python27. In my system variables, I have specified python to be C:\Python27 (I ... test.py in the command line, but when I do so I get this: File "<stdin>", line 1 python test.py ^ SyntaxError: invalid syntax
asked Jan 9 Mashhoodch 9.1k points
0 votes
1 answer 21 views
Problem: The CSV file contains 37 attributes + the label (last column). it doesn't contain header or index. Exp of the 1st row: 63651000000.0,63651000000.0,153.1,0,0,0,0,0,0,5,1,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ... "csv2libsvm.py", line 47, in <module> headers = reader.next() AttributeError: '_csv.reader' object has no attribute 'next' Do you have any idea about the problem ?
asked Jan 9 Mashhoodch 9.1k points
0 votes
1 answer 13 views
Problem: I want to read csv file by using c++ so here is my code int main(){ ifstream classFile("class.csv"); vector<string> classData; while (getline(classFile, line,',')) // there is input overload classfile { classData.push_back(line); } } here is my question ... +/ Library / John is there anyway that I can separate my last column from first of next row? Thank you and sorry that it is confusing
asked Dec 26, 2020 Mashhoodch 9.1k points
0 votes
1 answer 13 views
Problem I am developing some application using PHP, HTML and JavaScript. Now I am developing a feature, which will expose to user a download button, upon clicking it, server executes MySql query (I am using MySql as data base) and from data base response a file report is ... : &ldquo;Hey, this is CSV you can open it with Excel!&rdquo;. Tried to use &ldquo;echo&rdquo; it did not help a lot.
asked Dec 4, 2020 alexh 2.5k points
0 votes
1 answer 32 views
Problem: How Open CSV file using FileReader object? How Create BufferedReader from FileReader? How Read file line by line using readLine() method?
asked Nov 6, 2020 Mashhoodch 9.1k points
0 votes
1 answer 17 views
Question: How to select the csv file and then upload the content to mysql. Also, how to prevent the data from being duplicated in php. The field names of the csv is listed below. table: id name // cannot be duplicated talent // cannot be duplicated address email
asked Nov 2, 2020 RJ Lam 650 points
0 votes
1 answer 25 views
Problem: I need a quick PHP code that will export my records to a csv file. The fields in the record includes the item_id, item_name, item_description, item_price, item_qty. I needed these headers included in the csv.
asked Oct 31, 2020 RJ Lam 650 points
0 votes
1 answer 25 views
0 votes
1 answer 21 views
I need to export my SQL information to a csv file so that I can attached this file to email. But the code below is not working. I have two main concerns. There is no line break even I used the &ldquo;\n&rdquo;. The exported csv file is empty. $servername = " ... ,time()).".csv"; $csv_file = fopen ($csv_filename, "w"); echo $csv_Content; fclose($csv_file); Please help me to make this code working.
asked Oct 23, 2020 azriel 590 points
0 votes
1 answer 12 views
Is there any PHP code snippet that demonstrate on how to import a csv file to MySql database?
asked Oct 22, 2020 azriel 590 points
0 votes
1 answer 59 views
Hi, I need to save to my database from the csv file. My csv contains similar information in the code that I included here. "Last name", "First name", "SSN", "Test1", "Test2", "Test3", "Test4", "Final", "Grade" "Alfalfa", "Aloysius", "123-45-6789", 40.0, 90.0, 100.0, 83.0, 49.0, "D-" "Alfred", ... .0, 97.0, 96.0, 97.0, 48.0, "D+" "Gerty", "Gramma", "567-89-0123", 41.0, 80.0, 60.0, 40.0, 44.0, "C"
asked Oct 12, 2020 robin_gallo 420 points
0 votes
1 answer 16 views
I need to import a csv file that was generated by the system for me to import and save it to the database. But it generated an error &ldquo;array_combine(): Both parameters should have an equal number of elements&rdquo;. I was trying to debug my code but not able to see what cause ... $my_array[] = array_combine($keys, $data); } } fclose($csv); } /* if (($csv !== false) { }*/ return $my_array; }
asked Oct 12, 2020 robin_gallo 420 points
0 votes
1 answer 29 views
0 votes
1 answer 113 views
Problem: I am new to Python and CSV. Below is my code so far: import csv reader = csv.reader(open('new_file.txt','r'),delimiter=' ') row1 = reader[0] row2 = reader[1] row3 = reader[2] Please find below my new_file.txt this is row one this is row two this ... line 211, in <module> row1 = reader[0] TypeError: '_csv.reader' object has no attribute '__getitem__' I am unable to fix the above csv error.
asked Aug 24, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 111 views
Problem: I have a CSV file with full of data. I want to import the doc as a CSV file in my program and do some operations in my python program. As per my requirement, I wrote a script to import that file. Here is the script I&rsquo;ve written import csv with ... file. Do you have any idea about the error? It&rsquo;s completely going over my head. I am looking for a legit solution for it. Thanks.
asked May 2, 2020 Gavin 15.3k points
1 vote
1 answer 16 views
Problem: Hello guys, I have a big number of .csv file with full of data. I want to merge them all in a single file. It is a hectic job to copy all the data from each and compile into one single file. So, I am willing to combine multiple .csv files into one using ... me to do it. Thanks for your effort guys. Note: I named all the .csv files under a series. Let say they are named with data1-data100
asked Apr 6, 2020 Gavin 15.3k points
0 votes
1 answer 370 views
Problem : I am very new to the R, and after researching my error as below extensively, I am still unable to find the fix for it. I have already checked my working directory, and also made sure that the files are in a correct directory. Error in file(file, "rt") : ... sulfate", 1:10) In addition: Warning message: In file(file, "rt") : cannot open file './specdata001.csv': No such file or directory
asked Jan 4, 2020 alecxe 7.5k points