Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

XML to console using StringWriter expanding variables rather than writing strings literally

I have been using this function to dump XML to the console for review as I work on code to do some extensive XML manipulation, and for the most part it works as expected. function Write-PxXmlToConsole ...
Gordon's user avatar
  • 6,831
0 votes
2 answers
703 views

Fetch Millions of Records using CopyManager throwing OutOfMemoryError

When I tried running my code in tables with rows in thousands, it worked fine but as a performance testing, I tried it with tables having millions of records and then I encountered this issue. I have ...
Himanshu Arya's user avatar
0 votes
1 answer
99 views

C# 10 (De)Serialize XML property value AND attributes using StringWriter, StringReader and XmlSerializer [duplicate]

How do I (de)serialize the following xml element: <OtherInfo name=\"Some Name\" type=\"text\">Hello World!!!\n</OtherInfo> I define the following class to take care of ...
khteh's user avatar
  • 3,826
1 vote
0 answers
262 views

Why Java StringWriter close method throws IOException?

I wonder why Java designers made close() method on StringWriter throwing the IOException, when it actually does nothing. E.g. in PrintWriter, the exceptions are suppressed even though the PrintWriter ...
Mi-La's user avatar
  • 725
0 votes
1 answer
204 views

Writing RestAssured logs to StringWriter always seems to cut the last lines of the result

I am running RestAssured tests and I wanted to read info about the request from the logs ( to use in reports). I have a superclass with the following code which the test classes extent. The superclass:...
Kristrún Louise Ástvaldsdóttir's user avatar
0 votes
1 answer
236 views

How to remove first two columns and hyperlinks from repeater exported excel

I am exporting data to excel from repeater control, which contains some hyperlinks in multiple columns and link buttons in first two columns. I want to remove all hyperlinks as well as remove or hide ...
shekhar's user avatar
  • 13
1 vote
2 answers
451 views

Get parts of a string - C# .NET Core 3.1

I have a string line from a log: 2020-09-07 14:41:17.268 +01:00 [Information] Hello, Serilog! I would like to pull out the word Information from the string, however, this will change as it could be ...
user1574598's user avatar
  • 3,881
0 votes
0 answers
106 views

Changing values in XML when looping not saving the new values on next loop

Hey all I am having an issue with the code below due to me not being able to grasp what I am missing. I know the issue is that every call to searchXML() it just reads the original file that does not ...
StealthRT's user avatar
  • 10.5k
0 votes
0 answers
118 views

how to send multiple emails at one session using JAVA

i have a XML, where with that XML i mocked up test data by passing it in excel, i stuck up in getting the multiple mocked up string formatted files to send it to queue as a string. this is my string ...
saranya's user avatar
0 votes
2 answers
760 views

StringWriter processes strange characters on csv generated

I'm having troubles using StringWriter on our application. I do a rest call over a nosql db and it returns a list of dynamics. I use StringWriter to write a csv file that contains a header and ...
Matteo Pietro Peru's user avatar
3 votes
5 answers
9k views

Java writing a list of strings to a file, but the file is empty

I have found this question in other languages, but have yet to find a solution to this issue in a java application. I have a large .txt file with millions of records. Each record is /n delimited. ...
Jeremy's user avatar
  • 336
0 votes
1 answer
55 views

Duplication occurring during XML serialization of Class Object

I'm trying to serialize a class object into XML but the result ends up having it doubled. I pass the object into the function only once but duplicates by the time it passes through serialization. ...
the1APerson's user avatar
0 votes
0 answers
38 views

How to create and Download pdf file in c# using stringbuilder? [duplicate]

I am trying to convert create and download PDF file using String Builder using the following code but on "htmlparser.Parse(sr);" i get an error..Saying as: Input string is not in format. Thanks ...
user7436968's user avatar
6 votes
4 answers
28k views

C# Read text file line by line and edit specific line

I want to read a text file line by line and edit a specific line. So, I have put the text file into a string variable like: string textFile = File.ReadAllText(filename); My text file is like: Line ...
Giovanni19's user avatar
0 votes
1 answer
192 views

why groovy each function not iterating while inside another one

why groovy .each function is only one time iterating while it lies inside another one iteration like shown below code ? Code: @Grab('com.xlson.groovycsv:groovycsv:1.1') import static com.xlson....
Bhanuchander Udhayakumar's user avatar
0 votes
1 answer
183 views

What is correct way to use a static StringWriter in a web application?

I have a static StringWriter variable in a web application's Handler class, used by multiple private methods in the class. Each method appends a String to this variable, and finally the StringWriter ...
Ray's user avatar
  • 3,934
0 votes
0 answers
404 views

JaxB2Marshaller throwing Null pointer Exception

So, I have this method which marshals an object. public String marshalResponse(Object messageObject) { if (messageObject == null) { return null; } String finalstring ="No results ...
yashpandey8055's user avatar
0 votes
2 answers
1k views

converting datatable to xml giving outofmemory exception

While trying to converting a datatable data to xml through stringwriter. It si giving outof memory exception. My datatable contains about 20000 records. Below is the code I am trying DataTable dt = ...
sandeep.mishra's user avatar
0 votes
1 answer
2k views

c# serialization xmlwriter stringwriter out of memory for large objecthelp

I am managing a large project and need to serialize and send an object in xml format. The object is ~130 mb. (NOTE: I did not write this project, so making edits outside of this method, or ...
jo phul's user avatar
  • 647
0 votes
2 answers
202 views

StringWriter in windows universal app

I am absolutely new to programming. I'm trying to create a very simple app with three TextBoxes and one final TextBlock. I want to save the input from these three TextBoxes locally so I can read and ...
HelpPls4112's user avatar
0 votes
1 answer
1k views

StringWriter memory out of bounds exception

I have a method ExecuteResult, which is throwing a System.OutOfMemoryException at the line Response.Write(sw.ToString()). This is happening because the StringWriter object is too large in memory for ...
mgmedick's user avatar
  • 690
-2 votes
1 answer
822 views

System.Unauthorized Exception

* Exception =System.Net.WebException: Access to the path 'c:\windows\system32\inetsrv\Dialer' is denied. ---> System.UnauthorizedAccessException: Access to the path 'c:\windows\system32\...
lalatnayak's user avatar
0 votes
1 answer
389 views

Calling close on passed in member StringWriter to XMLTextWriter

I found some code that was not correctly wrapping XMLTextWriter and StringWriter with the using clauses. As I'm correcting it, I stumbled on a interesting question: do I have to explicitly add ...
tatmanblue's user avatar
  • 1,217
0 votes
1 answer
459 views

Why does gson use StringWriter in method toJSONString()?

From source code: public String toJson(Object src, Type typeOfSrc) { StringWriter writer = new StringWriter(); this.toJson((JsonElement)this.toJsonTree(src, typeOfSrc), (Appendable)writer); ...
JustFF's user avatar
  • 115
1 vote
2 answers
2k views

Pulling XML child inner node from XML to Java Object using JAXB

I have been trying to pull a child node from an XML which I received from a SOAP as string. I can retrieve the parent node but couldn't retrieve the child node. I also surf the internet to see if I ...
Prodigy's user avatar
  • 2,124
-2 votes
1 answer
266 views

Backslash using for escaping qute regenerate after asigning String

in ToString methode of my Entity, i try to generate a informational string includes quotes. so i use backslash before quote and everything is good until i try to assign return value to a string ...
Mahdi's user avatar
  • 768
0 votes
1 answer
2k views

How to add new header line asp.net Response.Output.Write?

I have a grid-view and I exported to grid-view data to word as shown below. The grid-view data and style works as I expected. Now I want to and new header line to word document and than send my grid-...
NTMS's user avatar
  • 846
0 votes
1 answer
2k views

Velocity Template merge method takes in a StringWriter but buff size not enough

I am trying to read from an excel file that contains more than 5000 rows and more than 10 worksheets using Apache POI , I get all the columns and row values and store it in a ArrayListMultiMap>, this ...
Sindhu Kodoor's user avatar
4 votes
2 answers
21k views

Using BufferedWriter to write to a string [duplicate]

I am trying to use a BufferedWriter to switch between writing to a File and writing to a String, but I have never used a BufferedWriter to write to anything but a file. Take this compilable code: ...
ryvantage's user avatar
  • 13.5k
-1 votes
1 answer
9k views

write csv file line by line using string in java

I had a modify my original csv. now I want modified csv file whether it is generate new csv file or updated on it ...how could it possible? I had a extract a single column values of csv and ...
vivek patel's user avatar
15 votes
2 answers
23k views

When should I use Java's StringWriter? [closed]

What is a Java StringWriter, and when should I use it? I have read the documentation and looked here, but I do not understand when I should use it.
MarkusWillson's user avatar
0 votes
2 answers
3k views

FileStream action writing empty file

I have an ASP.Net MVC 4 app that is downloading an empty file. What am I missing? Controller: public class HomeController : Controller { public ActionResult Index() { return View(); ...
drewwyatt's user avatar
  • 6,027
1 vote
2 answers
488 views

Is there anything (any way) to concatenate java Strings faster than StringWriter?

I am pulling a bunch of simple data and constructing a big (1kB - 2kB) String. I'm new to this language, but after reading, this seems likely the fastest (i.e. least amount of copying): String ...
Erik Bennett's user avatar
  • 1,081
1 vote
1 answer
65 views

Variable Preventing More Text Being Appended To String?

I am so lost at the moment as to why I cannot get something so simple to work! I am decrypting a value & appending it to a string, E.g. MessageBox.Show("TEST 1: " & DecryptedValue & " ...
SOL1102's user avatar
  • 512
0 votes
0 answers
739 views

Datatable row-wise iteration and printing

I have a datatable that I need to iterate row-wise and print it using iTextSharp in ASP.NET using C#. For each row retrieved in parent datatable dt, I print a child table dt_child. The dt_child is ...
divinediu's user avatar
  • 433
0 votes
2 answers
5k views

New Line in StringWriter

I need a new line in my StringWriter. It is just not happening. Please help. stringWrite.WriteLine(Header); stringWrite.Write("\n ========================================================"); ...
divinediu's user avatar
  • 433
2 votes
0 answers
140 views

Adding a Listener to a StringWriter

I have a class that creates StringWriters and passes them around. A calling class will write to that Writer. Is there any way for me to put some sort of Listener on the Writers as they are being ...
chama's user avatar
  • 6,163
2 votes
1 answer
2k views

Why are \r\n added to my string?

\r\n appearing on string? Attempting to use the example on Rendering ASP.NET MVC Views to String to pass a VIEW as a string, and send as an Email. Which should send the invoice of a sale through ...
John's user avatar
  • 3,935
3 votes
1 answer
249 views

Pass a VIEW as a STRING

Attempting to use the example on http://weblog.west-wind.com/posts/2012/May/30/Rendering-ASPNET-MVC-Views-to-String to pass a VIEW as a string, and send as an Email. Which should send the invoice of a ...
John's user avatar
  • 3,935
0 votes
2 answers
2k views

save file as excel is folder using string writer

I have created excel file from asp.net table and am now able to download it. Now I want to save this excel file on the server to be able to use it. I have tried to use string-writer to save the file ...
sp_m's user avatar
  • 2,697
0 votes
1 answer
519 views

StringWriter write to folder

Good Afternoon. I want to use the StringWriter to write the new file to a network folder. Can anyone give me some examples using the code below on how to do this? It's my first time working with ...
WHAT's user avatar
  • 11
4 votes
1 answer
391 views

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 ...
Zibbobz's user avatar
  • 755
7 votes
4 answers
21k views

"File is being used by another process" after File.Create()

I have an application that creates a text file if the file doesn't already exist and then writes something to it. It works great the first time through, when I am creating and immediately writing to ...
Brandon's user avatar
  • 945
7 votes
2 answers
13k views

Render partial view to string MVC4

I am using the following to render a partial view to a string... protected string RenderPartialViewToString(string viewName, object model) { if (string.IsNullOrEmpty(viewName)) ...
MrBeanzy's user avatar
  • 2,296
0 votes
1 answer
352 views

XML getting wrong UTF encoding

I am trying to encode my xml text using utf-8 with the code below. For some reason I am getting utf-16 instead of utf-8. Any reason why please? StringWriter writer = new StringWriter(); ...
Mark Fenech's user avatar
  • 1,358
2 votes
4 answers
36k views

String Writer writing into text file

I have 100 textboxes , and i am trying to get all the text from these textboxes to be written into a textfile , this is my code : protected void Page_Load(object sender, EventArgs e) { for (int ...
user2376998's user avatar
  • 1,071
6 votes
1 answer
3k views

Return all attributes of an HtmlElement in Web browser

I need to get all of the attributes from my webbrowser.currently,I am using GetAttribute() but this way,I need to know the name of the attributes. Imagine I do not know what is in my webbrowser. My C# ...
Pedram's user avatar
  • 728
0 votes
1 answer
2k views

Java StringWriter StringBuilder exception at toString

Ok.. this is totally weird. I'm trying to make a http request in android. It works and I can 'build' a string using StringWriter but the code throws an exception at writer.toString(). It makes no ...
user568021's user avatar
  • 1,466
1 vote
2 answers
2k views

Write chinese characters from one file to another

I have a file with Chinese characters text inside, I want to copy those text over to another file. But the file output messes with the chinese characters. Notice that in my code I am using "UTF8" as ...
ianrey palo's user avatar
42 votes
5 answers
19k views

Will not closing a stringwriter cause a leak?

I realize that in java the GC will eventually cleanup objects, but I'm asking if it is bad practice to not close your string writer, currently I am doing this: private static String processTemplate(...
Blankman's user avatar
  • 266k