hello,
I have a csv file that has 13 columns. Some columns are filled, some are blank. What I need to do is pull up the csv file, read the columns into a list or array and then put each column into its own variable that can be referenced in an email script that I've already written.
Here is my code so far where my output is all of my columns but I'm stuck after this. Any help would be greatly appreciated!
...
Search Result
Collapse
25 results in 0.0045 seconds.
Keywords
Members
Tags
-
csv columns into variables
-
Fixed width txt to csv
Dear users and helpers,
I searched online, but could not find the answer to my question. I need convert a txt file to a csv. I have figured out how to do this with delimeters, however, the txt file does not have any delimeters or headers so I must set fixed width numbers. The file has millions of records. The widths for the columns are 10, 60, 60, 60, 30, 2, 3, 6, 9, 5, 6, 12, 12, 5, 3, 12, 12, 5, 3.
My two challenges are:... -
How to use python to add a column to a csv file?
Hello all!
I have a csv file which is usually has between 100 and 200 columns. I have a new column of data that I want to add to the csv file. I know if you open the file as "A" it will append the file, but I only know how to use it to add new rows to the document. not new columns.
Right now this code will write three columns of data:
Code:myFile= open( "CC4.csv", "wb" ) wtr= csv.writer(
-
How to read user input into a struct and add to a csv file?
Hi all,
I am trying to use the variables I have in the struct to store user input about a car.
Code:struct CarC { string carRegistration; string carOwner; string carOwnerAddress; string carManufacturer; string carModel; unsigned numCarDoors; unsigned numCarSeats; string carType; string carInformation; };
-
CSV/C++ Problem
Hi all,
I am having a problem where the user must enter the file which they would like to open, which displays information about vehicle details that have been stored as CSV.
Code:NF39 FEO, Mr George Thomas, 29 Gillian Road, Safeways, Red, 5, 92, Normal Bus, -
... -
Getting PHP veribles from CSV
I'm trying to output verbless from a CSV file into PHP. The PHP file is logs from the UPS management software, thus I'm only interested in the last line.
To date, I can get the last line number to be output and I can putout the array of data. But I can't seem to link the last line to verbless.
Code:<?php //$filename = "c:/Program Files/MonitorSoftware/UPSDATA.CSV"; $filename = "UPSDATA.CSV";
-
How to parse csv using DictReader?
Im trying to create a visualisation from radiation data from Japan, from this website: http://www.sendung.de/japan-radiation-open-data/
It is in csv format. I was told python is good for parsing csv.
Im struggling to get to grips with how to use the csv module to parse specific rows of data. I tried using DictReader but Im really not getting anywhere, total noob.
There are four column headers: station_id, datetime, sa,... -
How to Import CSV into MS SQL?
I have an XLS file which has a lot of merged cells and empty cells. When I save the file as a CSV, the merged cells are no longer merged, but the empty cells remain. When viewed in Notepad, there are commas without any values between them. How do I import such a file to MS SQL. Additionally, which query/command would be ideal if I were to import this file on a regular basis, say, daily? How do I import it dynamically and how can I perform a cleanup... -
List of string to float
Hi,
I'm reading from csv file using csv module and end-up with a list of string (while actual data is time stamp or float)
lst=['2010-02-15 18:22:08.918000 ', '2010-12-11 00:00:00.000000 ', '10740.0', '10740.0', '10750.0', '10745.0', '10741.2457045']
How can I convert list to date time and float using minimum line of fastest code. Fastest because csv size are upto 20 MB and have hundreds of them to read from.... -
How to use python to write to a specific cell in a csv file?
Hello all!
I have a list of 5 characters
Code:>>> li [1,2,3,4,5]
Right now what I am doing is this:
Code:myFile= open( "FILE.csv", "wb" ) wtr= csv.writer( myFile ) for li in zip(li): dRow=[li] wtr.writerow(dRow)
-
How to loop to make many .csv files?
Hey guy!
I have a couple questions, which I don't think are too advanced. I created an algorithm called "Best" for simplicity I will not include the mathematical details of it. I ask the user to input 6 values: Stock, min,win,Stop,GO , and end. Looking at the last 5 inputs, they are all integer inputs eg: 1,2,3.
This code will take my algorithm and spit out a csv file called "boom.csv" with two columns of numbers... -
MySQL export into CSV : number cells are not recognized as numbers
Hi,
I've got a PHP script that create a CSV file from a MySQL query. It outputs columns of data perfectly fine. The only problem is that Excel doesn't recognize the numbers as being "numbers" (that you can manipulate).
For example, if I have 2 cells with numbers 121.3 and 345.2 and I want to add them up, I will get an error. I've checked the formatting of my cells and made sure it's set to "Numbers",... -
Read hyphen from a CSV file
I have a small application which reads a CSV file using OLEDB dataadapter into a datatable. I have a scenario where the cells can contain only a hyphen(-). But the dataadapter reads it as zero(0).
Please suggest a solution.Thanks . -
Unwanted characters while reading Japanese from a Excel based CSV file.
I have excel file which has got mixed of Japanese & English written in it. I need to read it using stream reader, I changed it's extension as .CSV and now I am trying to read all the content.
While reading, I am getting random numbers/alphabets/and hexa blocks.
Can anyone please have a look and let me know what is the best way to read out Japanese from a excel changed CSV file?
Here is my code:
... -
How to convert XML to CSV?
Hello All,
I am developing a project in which i have to feed the data in the form of CSV. But the data that I am getting is in XML format.
I need help as to how we convert an XML file into CSV.
Please reply asap!