Questions tagged [writer]

an abstract class, interface or naming convention which is used to state that the given object is used to write data to a file, stream, device or other destination

A Writer clause is often used as a part of a name of an object in object-oriented programming. Good examples are BufferedWriter from Java 6 or StreamWriter from C#.

Abstract writers are often defined as interfaces or abstract classes to provide means of making the process of writing separable from what is being written. In Java or .NET there are Writer implementations for files, network connections and, more general, streams.

456 questions
4
votes
4 answers

How do I put single-quotes around string using Python csv writer?

with open("emails.csv", "w") as csvfile: for control_rent_email in control_group_renters: email_writer = csv.writer(csvfile, quotechar='"', quoting=csv.QUOTE_NONNUMERIC,delimiter=',') email_writer.writerow([control_rent_email]) …
user1947085
  • 177
  • 1
  • 4
  • 7
4
votes
1 answer

Conflict Between StaticWriter and Writer Classes

As of our recent move from WSED 5.2 to RAD 7.5, an application-wrecking bug has appeared in our code. RAD 7.5 marks it thusly, all at the declaration of the class header (public class FoStringWriter extends StringWriter implements FoWriter {) -…
Zibbobz
  • 725
  • 1
  • 15
  • 41
4
votes
2 answers

C# binary writer customization

Is there a way to customize the way a binary writer writes out to files so that I could read the file from a C++ program? Eg: myBinaryWriter.Write(myInt); myBinaryWriter.Write(myBool); And in C++: fread(&myInt, 1, sizeof(int),…
Tom Tetlaw
  • 83
  • 1
  • 10
  • 21
3
votes
3 answers

Python csv.writer adds unwanted characters

I am letting my script read a csv file and I want to save it first into an array, then slice the second element (which is the second line of my csv file) and write the array back to the csv file. csv file looks like this before: first…
Santos
  • 39
  • 5
3
votes
1 answer

Help understanding the Reader/Writer pattern in .NET

Here's the documentation for the method XContainer.CreateWriter: Creates an XmlWriter that can be used to add nodes to the XContainer. I parse the text with my mind, I get: A method implemented by the class XContainer Returns an instance of the…
Aaron Anodide
  • 16,906
  • 15
  • 62
  • 121
3
votes
1 answer

Creating and loading Avro file, file gets created but empty

I am reading a CSV file and loading it into an Avro file in the GCS bucket. The Avro file gets created but there is no data. There is data when I print. I checked the buffer but there is no data in the buffer as well. I tried writer.close() but I am…
3
votes
0 answers

OpenCV Write Video does not work inside Docker Container

I have coded a script that records a video for a specific time interval through a PiCamera and saves it in a defined Folder. I use the method VideoWriter and the method write. The script works perfectly when I run it on the host but if I…
3
votes
1 answer

Specify Header and Footer for all file created by MultiResourceItemWriter when writing in multiples files -spring batch

I have a batch that read from data base using JdbcPagingItemReader, process each record from the database in a java class then write it to a file using FlatFileItemWriter. It appends also a header and footer for this file using…
Abenamor
  • 278
  • 1
  • 4
  • 15
3
votes
1 answer

Excel::Writer::XLSX adds an unexpected @ in formula

I am writing a formula to an xlsx file using Excel::Writer::XLSX use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( "test.xlsx" ); my $worksheet = $workbook->add_worksheet(); $worksheet->write( 'A1', "4"); $worksheet->write( 'A2',…
Jean-Marc
  • 133
  • 1
  • 9
3
votes
2 answers

java.io writers and readers - how do you know which should be used?

There are quite a few classes that extend java.io.Writer and java.io.Reader. Are there circumstances where you should use one over another? What is the overall usefulness of each of them (why are there so many)? Do they have difference "performance"…
Cheetah
  • 13,785
  • 31
  • 106
  • 190
3
votes
0 answers

ORC Stripe Size settings in Pyspark or Scale issues

I am having issues setting the stripe size, index stride and index on an orc file using PySpark. I am getting approx 2000 stripes for the 1.2GB file when I am expecting only 5 stripes for the 256MB setting. Tried the below options Set the .options…
John_Che
  • 1
  • 4
3
votes
1 answer

TypeError: to_excel() missing 1 required positional argument - despite using excel writer

I've been having trouble saving to excel using pandas with the following error: File "C:/Users/Colleen/Documents/Non-online code/kit_names.py", line 36, in save_sheet_names pd.DataFrame.to_excel(writer) TypeError: to_excel() missing 1 required…
Colleen
  • 143
  • 1
  • 3
  • 14
3
votes
5 answers

My CSV writer code writes separators between characters and not strings

I have written code which writes to a CSV file, reading from another file. I want to write out particular columns from the input file, so I append them to a list, then separate them by a comma and add them to the row, but the output file shows that…
abhihacker02
  • 51
  • 1
  • 9
3
votes
2 answers

Python 3 - CSV writer loop won't close after CSV reader reaches end of file

I'm trying to create a program that splits large CSV files into smaller ones. I've got the function working great, except it doesn't ever close the last file, which means it never finishes writing to that file. Here's what I've got: import…
Matt Lefevre
  • 75
  • 1
  • 9
3
votes
4 answers

How to test this file-writing, 3lines function?

This is my method in some service class. It's public so it should be tested. I simply do not know WHAT should I test. I'd mock Writer and spyOn function call, but with this implementation it's impossible (isn't it?) I'm using Mockito and JUnit For…
Konrad Dziurdź
  • 717
  • 3
  • 8
  • 15