Questions tagged [csvwriter]
58 questions
1
vote
1 answer
Convert nested json data into CSV file using csv-writer
This is the logic that I have followed. I am getting proper results when I am just passing { id: 'title', title: 'Title' } into csvFields. But I am not getting any result when I try to get task.model i.e nested fields into my output csv file. Do I…

Mohammad Zuha Khalid
- 87
- 9
1
vote
3 answers
How to write in separate cells with python csvwriter?
I'm reading a sequence of files and writing them and their parameters in lists, then I want to create a csv which looks like this:
File1
parameterA1
parameterA2
File2
parameterP1
parameterP2
parameterP3
What I get with my…

Apollo
- 31
- 5
1
vote
2 answers
write multiple dict to csv in python
I am trying to write below two separate dict values with the same key header to the csv file using python.
{'instrumentType': 'Stock Futures', 'expiryDate': '25-Jan-2023', 'optionType': '-', 'strikePrice': 0, 'identifier':…

Wanabee
- 11
- 4
1
vote
0 answers
csvwriter, commas separators create undesirable columns between the actual values
I am trying to create a CSV file I can open with excel from an API data extraction (I don't know how to import it here) by using csvwriter, however for now commas separators are considered a value and added to columns between the actual values.
My…

Duperito
- 11
- 5
1
vote
1 answer
Is that possible to combine two csv files into one as mentiioned below
I am trying to combine csv file into one as below mentioned
input1:
Name,Age,Department
Birla,52,Welding
Rob,45,Furnace
input2:
YearofService,Audit
14,Y
8,N
My expected output…

Yes_par_row
- 79
- 6
1
vote
0 answers
Special characters getting added while reading data from csv in C#
I am writing data in CSV and reading the line from CSV in C#.
When I am writing data -
using StreamWriter streamWriter = new StreamWriter(outputFilePath);
using var csv = new CsvWriter(streamWriter, CultureInfo.InvariantCulture);
In CSV file data…

Kavita Korgaonkar
- 11
- 3
1
vote
1 answer
Reading existing csv and then writing back to CSV puts inches expressed as double quotes in a cell as "" instead of \"
I have a CSV that I generate by building StringBuilder and writing to using PrintWriter. Then I read that CSV again and append something to it, but it messes up the cell which has double quotes in it, used to denote inches.
It prints double-quotes…

Atihska
- 4,803
- 10
- 56
- 98
1
vote
2 answers
csv writer - How to write rows into multiple files, based on a threshold?
I want to write rows into csv file, but file should contain no-more than X rows. If threshold exceeded it needs to start a new file.
So if I have the following data:
csv_max_rows=3
columns = ["A", "B", "C"]
rows = [
["a1", "b1", "c1"],
…

Shoham
- 7,014
- 8
- 40
- 40
1
vote
2 answers
CSV Writer (Python) with CRLF instead of LF
Hi I am trying to use csv library to convert my CSV file into a new one.
The code that I wrote is the following:
import csv
import re
file_read=r'C:\Users\Comarch\Desktop\Test.csv'
file_write=r'C:\Users\Comarch\Desktop\Test_new.csv'
def…

John Snow
- 107
- 1
- 10
1
vote
2 answers
Writing to CSV in Python- Rows inserted out of place
I have a function that writes a set of information in rows to a CSV file in Python. The function is supposed to append the file with the new row, however I am finding that sometimes it misbehaves and places the new row in a separate space of the CSV…

Luke Ashton
- 39
- 1
- 6
0
votes
2 answers
which variable do I use to write the data to csv file
how would I adjust my code so that I can print the debit and credit to a csv file please.
I've included the code below and am having trouble making sense of what variables to use and where, with the csv module. I've also included the error message…

n3cr05c0p3
- 3
- 2
0
votes
1 answer
Writing to file in a Popen subprocess
I am attempting to log the simultaneous serial outputs of 3 GPS receivers to compare their performance on a single computer.
Following the structure outlined in this post, I created a main file which takes in inputs about the current trial for the…

Mattman7306
- 1
- 3
0
votes
0 answers
using CsvWriter with Custom column order using multiple class sources
Hello I'm trying to write to a csv file using 2 classes as a data source. The output should have 3 columns and X amount of row.
class MyClassA
{
public string some_string1; //column 1
public string some_string2; //column 3
}
class…

Anthony R
- 89
- 1
- 10
0
votes
1 answer
How to create a new log file each day with python csvwriter?
I use this script to read parameters from a boiler's data bus every 10 seconds and write them to a csv file:
from subprocess import check_output, Popen, PIPE
import csv
from datetime import datetime
import threading
bai = ['/usr/bin/ebusctl',…

Mike
- 3
- 3
0
votes
1 answer
how to export bitmap data from Sqlite database into .csv file using android app
I have developed an android app which exports the data from the SQlite database into a .csv file. I am able to export all the data successfully except for the BITMAP data. I am storing the bitmap as a Blob datatype in SQlite database and as byte[]…

Lakshmi
- 92
- 1
- 7