TextWriter is an abstract base within the .NET Framework, and represents a writer that can write a sequential series of characters.
Questions tagged [textwriter]
73 questions
0
votes
1 answer
JSON Textwriter Formatting
How can I format this structure with JsonTextWriter...
"truck": {
"number": "9999",
"type": "FM",
"vinNumber": "vin750",
"licensePlate": {
"number": "12345",
"stateProvince": "IN"
}
…

Michael Gee
- 11
- 2
0
votes
0 answers
TextWriter only returning 350 lines?
I have the following controller and service that returns data to the user to populate an Excel file. In LocalHost with SQL Server Express, it works great.
However.... it's only writing 350 records when running from a cloud environment. Any idea why…

JReam
- 898
- 2
- 13
- 28
0
votes
1 answer
Using TextWriter to write text files with parametric fileName
I have to write some text on text file using TextWriter.
My code is as follows:
static void Main(string[] args)
{
List _list_1 = new List() { 1, 2, 3, 4 };
List _list_2 = new List() { 5, 6, 7, 8 };
var _year = 2005;
…

maliks
- 1,102
- 3
- 18
- 42
0
votes
2 answers
Can't write to CSV
This is the first time I'm using csv and c#.
This is the code, its running, and creating the csv, but it doesn't write anything.
The code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using…

B.Cox
- 23
- 5
0
votes
2 answers
C# Efficient Skip Console Writeline?
A C# .NET exe (4.6.1) outputs a lot of status by calling a method that does Console.Writeline. So much that it visibly slows down execution. First thought was to add a bool and/not do the Writeline within the called method based on the value.…

Snowy
- 5,942
- 19
- 65
- 119
0
votes
1 answer
Ghostscript textwriter preserve blank lines
I'm trying to convert pdfs to text files.
I use this command to perform the conversion:
gs -dBATCH -dNOPAUSE -sDEVICE=txtwrite -sOutputFile=output.txt input.pdf
Ghostscript version is 9.07.
I get all the text shown in PDF. I'd like to preserve the…

Will
- 1,718
- 3
- 15
- 23
0
votes
1 answer
MS Word shows only first record from a rtf file created by TextWriter
I'm using TextWriter to make a RTF file based on a string.
TextWriter tw = new StreamWriter(@"C:\test\test.rtf",false,Encoding.GetEncoding("iso-8859-1"));
tw.Write(text);
Beneath is the string I feed to TextWriter. I built it…

Jooj
- 91
- 2
- 9
0
votes
3 answers
I'm trying to write text to a .txt file but it doesn't work
I'm trying to write some info to a text file when there is an error in the application. I added this code to the Application_Error method in global.asax but it still dont work:
void Application_Error(object sender, EventArgs e)
{
string path…

Shaked Dahan
- 402
- 5
- 22
0
votes
2 answers
TextWriter/StreamWriter high memory usage
I have a console app that reads in a large text file with 40k+ lines, each line is a key that I use in a search for which the results are written to a output file. Issue is I leave this console app running for a while until it just suddenly closes…

Thao Nguyen
- 901
- 7
- 22
- 42
0
votes
0 answers
C# TextWriter writing weird characters
I have a server that is writing some text files, but since the text in question has some specific latin characters, such as "á","ã" and "é" , the result turns out to be quite odd. TextWriter in C# supposedly writes with utf-8 encoding, so that…

smith
- 194
- 3
- 15
0
votes
0 answers
While loop keeps returning duplicate information
I have a function that is meant to get values from a SQL database table (called ProductProfiles) and display them inside a .csv document that users can download and view. The results are based on a drop down list's selection (called…

Dejsa Cocan
- 1,539
- 3
- 19
- 56
0
votes
1 answer
Access to stream of ViewContext's writer
I'm writing an html helper extension for MVC5.
I need to access the ViewContext's stream to edit it.
(like a textreader)
htmlHelper.ViewContext.Writer.Write("
");
Is there any way to access the stream; so that I can manipulate or add some html…

freewill
- 1,111
- 1
- 10
- 23
0
votes
2 answers
whats the best way to generate an XML file if all tags (including closing tags) and their values come from DB?
I have a situation where I have to generate some XML files based on data that comes from DB. The structure of the data that is stored in DB is the problem. Actually all the TAGs and their values are stored in a table which also include closing TAGs…

Aamir
- 1,747
- 5
- 26
- 50
0
votes
1 answer
c# "Cannot write to a closed TextWriter." on a string object?
this error has appeared to many of the users, but in my case Visual studio seems to be pointing on a string object.
My code is the following:
protected delegate void DPrint_To_LogScreen(string Text, bool NewLine);
protected void…

Yann
- 180
- 3
- 14
0
votes
4 answers
Need to write many customer records to a single line in text file
I have a client that wants a text file with all the text on a single line. Like an EDI file has.
I have a datatable with thousands of customers and customer information. My method loops through the datatable grabs the customer info and writes it…

J.R.
- 41
- 3