Skip to main content

All Questions

3 votes
2 answers
253 views

C# StreamReader throws OutOfMemoryException on last line when splitting large delimited text file

I am writing a function in C# to split a large delimited file into smaller delimited files. I am writing this function because a 2.7 GB file was taking hours to ETL and was causing a bottleneck to ...
zBomb's user avatar
  • 361
0 votes
2 answers
2k views

How do I overwrite a file if it already exists?

I'm making a text editor using fastColoredTextbox. I have a button that allows you to save your text onto your pc. The problem is that it throws an exception when the user tries to save the file as a ...
John's user avatar
  • 1
-1 votes
1 answer
90 views

c#, steamwriter only writes one line

I'm taking data from multiple text files using streamReader and putting it together into one text file using StreamWriter in c#, visual studio. Each text file has multiple lines, each line contains ...
ShadySpiritomb's user avatar
0 votes
1 answer
1k views

Reading from text file using StreamReader

I have a text file and I'm using a StreamReader for read the entire file to a String array (String[]). So I'm using the StreamReader.ReadToEnd().Split() method for this. But the text file can contain ...
Zoltán Orosz's user avatar
1 vote
1 answer
682 views

How to remove a blank line at the end of a text file after deleting a line?

I borrowed four lines of code from Stack Overflow, regarding removing a specific line from my text file in vb.net. Here they are: Dim delLine As Integer = 4 Dim lines As List (Of String) = File....
claudebl's user avatar
1 vote
1 answer
125 views

Cannot get user input to write to my text file in C# (error says path cannot be accessed because it is already in use)

I am at a loss as to what more I can do here. I have attempted to use namespace StreamReadWrite but that did not work. I have tried to use file.Close(); in different areas but the most that would ...
user12515401's user avatar
2 votes
3 answers
1k views

Write double to text file with dot separator

I need to write several doubles in text file with dot separator. I know, that this code is the solution: StreamWriter f = new StreamWriter(file, Encoding.ASCII, 128, false); double a = 1.057887; f....
Perotto's user avatar
  • 326
0 votes
0 answers
42 views

How to send information from a DataGridView to a textfile

I am currently working on a weather forecasting application which stores forecasts in a textfile. The functionality of capturing the information into a textfile has been complete. I have also ...
Faheem's user avatar
  • 1
0 votes
2 answers
2k views

Remove characters from text file when appending strings with backspaces

Is it possible to append a string containing backspaces to a text file and treat all the backspaces in it as a "remove last char" operation? E.g. My text file: This file has two lines Some ...
sɐunıɔןɐqɐp's user avatar
1 vote
2 answers
125 views

C# String not printed on sameline StreamWriter issue

The follwoing code is used by me to print entires in a datagrid view into text file by converting them into strings! The data grid view has 3 columns(3rd column has several strings) and I want to ...
Kushan Peiris's user avatar
29 votes
3 answers
121k views

How To Overwrite A File If It Already Exists?

I'm making a music player. It has 2 forms; one is the main area where you play music. The second form has a CheckedListBox where you select the mp3s you want. When I click a button, it saves the ...
Manny's user avatar
  • 345
0 votes
1 answer
484 views

How to send CheckedListBox selection into textfile?

I'm trying to code on my own for the first time, and decided to make a music player on Winforms. I have a CheckedListBox that is already populated with the names of songs in a folder. When I click a ...
Manny's user avatar
  • 345
0 votes
1 answer
41 views

Error when trying to Delete Line from TextFile from ListView Item Click - Android C#

I am trying to delete a line from a Text File by clicking on the listed string item in a ListView, but i am getting an error. The method I am using is to Store the TextFile lines in a Line<string&...
CodePlague's user avatar
1 vote
3 answers
11k views

The process cannot access the file 'C:\file.txt' because it is being used by another process

I am trying to log each method on my program, I have the application deployed on IIS Server and the user just called me and said the email functionality is not working so I need to basically run the ...
CodeMan's user avatar
  • 133
0 votes
3 answers
62 views

How do i change a specific line in a textfile

Im trying to read from a textfile into an array, change one element and then read array back into the file but not appending the original text. But it says the file is being used by another process. ...
Adam Higgins's user avatar

15 30 50 per page