All Questions
Tagged with streamwriter text
27
questions
-1
votes
1
answer
689
views
Sort lines in a text file by value
I would like to like the WPF application saves time similar to the one in the rankings. Time and number of attempts is not a problem to list but the problem occurs when I want to sort it in a text ...
0
votes
2
answers
5k
views
Check if text exists in text file
I'm trying to figure out if the text URL that I get from current URL exists in 'linkx.txt', if it does then show a message, if it doesn't then write to text file. however, when I run this code program ...
0
votes
3
answers
40
views
Add text with the 1st line that is written to an external file
Here is my problem...
I am validating rows length from a text file, one row at a time. If the length is <= 2033, it goes for processing. If it > 2033, it goes in a different file.
I would like ...
0
votes
1
answer
61
views
MySql to .txt in C# WPF
I am trying to get a table from my local database to download into a .txt. I've and I'm honestly at a loss.
It has to be in a txt for simplicity of other users. I've tried a few different ways, I've ...
1
vote
1
answer
461
views
Without Overwriting, is it possible to remove string from a text file?
I am trying to append a line to a text file but by removing the enclosing bracket first.
Below is how my text file data format looks like
{
"1455494402": 8,
"1456272000": 2,
"1456358400": 1}
...
0
votes
0
answers
67
views
How Do I Delete Selected Item which is saved in a text file
This Piece of code:
//Adds a user named server into the serverlist box
serverListBox.Items.Add(this.serverTextBox.Text);
//saves that user named server into a text file where the user can load the ...
-1
votes
2
answers
88
views
How to add a line to an existing txt with C# [duplicate]
I would like to an a new line to a txt file. I've tried this with StreamWriter but it seems to clear the txt then add the line i want and nothing else. I was just wondering is there away to do where i ...
1
vote
1
answer
764
views
C# using Streamwriter: last "buffer" is appended twice though using Flush()
I've read a lot about using the Streamwriter. At least I have a solution that nearly works - but in some files, the last line is appended twice.
I tried inserting Flush() at the end of writing and ...
2
votes
1
answer
152
views
StreamWriter not appending to file, instead creating a new file in different directory
I am attempting to write from one file to a temp file after making certain changes to some of the data in the source file. This was working until I extracted this logic into its own function.
After ...
0
votes
3
answers
1k
views
System.IO.StreamWriter : Why do I have to use keyword "using"
//C#
using (System.IO.StreamWriter writer =
new System.IO.StreamWriter("me00.txt", true))
{
writer.WriteLine("Hey"); //saved
}
System.IO.StreamWriter writer02 = new System.IO.StreamWriter("...
0
votes
1
answer
76
views
Removing instance of line only after first instance has occurred when writing a new file
Sorry for my terrible topic title but I couldn't think of another way to define it...
I am reading a text file and then missing out particular lines and then writing the lines I want to keep to a new ...
0
votes
3
answers
311
views
Replacing a word in a text file
I'm doing a little program where the data saved on some users are stored in a text file. I'm using Sytem.IO with the Streamwriter to write new information to my text file.
The text in the file is ...
0
votes
2
answers
2k
views
Write textbox text to a file while keeping newlines
I have tried using:
StreamWriter.WriteLine()
StreamWriter.Write()
File.WriteAllText()
But all of those methods write the textbox text to the file without keeping newlines and such chars. How can I go ...
1
vote
0
answers
237
views
Reading a text file in java, then writing a new file
I'm trying to format the printwriter on this code to only print lowercase and remove all non-alphabetic characters.
Cheers
import java.io.*;
public class TextFile {
public static void main (String[]...
0
votes
3
answers
384
views
How to save files from two listboxes c#
i was doing a project. In the project, I needed to add values into a listbox. When I press the add button:
lbxOverhead.Items.Add(tbxAddItem.Text);
lbxItemPrices.Items.Add(tbxAddPrice.Text);
I then ...