Questions tagged [file.readalllines]
88 questions
1
vote
1 answer
file.read returning empty list
file1.seek(0)
exec(i + ".seek(0)")
readd = exec(i + ".readlines()")
print(file1.readlines())
I have already opened the file as "r+"
the file contains content, but the code returns this:
[]
None
I did seek to the beginning but it still doesn't…

Javier Albarracin
- 69
- 3
1
vote
3 answers
Relative path on File.ReadAllLines method
My code access a file which is in "Conf" directory inside my project directory. I am currently opening the file using absolute path like below:
File.ReadAllLines("C:\project name\Conf\filename");
I was thinikng if it's possible to use the relative…

Rahul
- 76,197
- 13
- 71
- 125
1
vote
1 answer
c# search last key word .log file
I am trying to search through a text /.log file for the key word "DEBUG 2018-06-04T13:27:15+00:00"
Once the last key word DEBUG is found, I would then like to compare the date and time to current date $ time and if older than 10 minutes output fail.

Ettienne
- 23
- 3
1
vote
0 answers
Fill Listbox with System.IO.File.ReadAllLines and a vaiable Filename c#
im learning c# and started to Programm a tool for my own.
I fill some listboxes with a TextBox and save this listbox to a txt file.
This works fine with: System.IO.File.WriteAllText
When i start the Programm again, the listboxes will fill direct…

steffen1994
- 247
- 2
- 12
1
vote
1 answer
Load/split a .txt into multiple listboxes.?
I am trying to figure out a way to load a very large .txt file and thought if I break it into sections (Listboxes) it would load faster and be easier to manipulate with less lag. Or is there a way to OFD with a background worker?
Here is how I am…

Bobby_Boner
- 21
- 5
1
vote
1 answer
Parsing a Log (text file) with colors in C#
I'm creating a log reader that will be Color Blind Friendly that will parse a log file (text file) with the default color of blue. When a line contains "ERROR:" it should set the color to Orange. Sounds simple enough but the code I whipped up does…

Gregory Munson
- 11
- 5
1
vote
1 answer
Delete, copy, and paste string in an array in a text file to a new arry in a text file
I need some help with file streaming. I have a program that will record names into a string array that will be written to a .txt file. Then if a user wants to delete a specific string from the array in the .txt file. the program will search for the…

Spr89
- 81
- 1
- 9
1
vote
3 answers
How can I used ReadAllLines with gzipped file
Is there a way to use the one-liner ReadAllLines on a gzipped file?
var pnDates = File.ReadAllLines("C:\myfile.gz");
Can I put GZipStream wrapper around the file some how?

ManInMoon
- 6,795
- 15
- 70
- 133
1
vote
1 answer
System.IO.File.ReadAllLines returns zero strings
Good day!
I try to get all lines from file.
Case: I write some strings into file (some WriteClass) and then try to get all lines frm it.
via
var lines=System.IO.File.ReadAllLines(fileName,Encoding.Default);
Bit Count of lines==0!
And i havent any…

user2545071
- 1,408
- 2
- 24
- 46
1
vote
2 answers
Input string was not in a correct format String to double [] [] array
I know that there are more threads on this topic here, but none of them actually helped me.
I will provide whole code:
namespace ConsoleApplication1
{
public static class Load
{
public static double[][] FromFile(string path)
…

user2886091
- 725
- 7
- 16
- 29
1
vote
1 answer
C# (encog) load dataset from txt file
I would like to build a simple neural network with ENCOG to perform classification. I found a example that shows XOR. There is a double array that contains inputs and another array that contains ideal outputs for the learning process. So the dataset…

user2886091
- 725
- 7
- 16
- 29
0
votes
1 answer
How to best and most efficiently Split files into vb.net
Say I have a 5 GB file. I want to split it in the following way.
First 100 MB is on the file
The rest go some reserve file
I do not want to use readalllines kind of function because it's too slow for large files.
I do not want to read the whole file…

user4951
- 32,206
- 53
- 172
- 282
0
votes
0 answers
I try to read file content from a file on a remote network path. I get the Error (it is being used by another process) How can I overcome this?
I know that there are some good answers for this problem, but in my case I think there is something special:
In my C# project (running on a server) I want to read the content of a file that is on a remote CNC machine's IPC. I open a new connection…

Mdarende
- 469
- 3
- 13
0
votes
1 answer
Creating a string array that contains each line from a file in C#
I'm trying to create an application that confronts a string given in input by the user to a series of words written in the file. Each word is written on a different line without spaces between the lines. They look like…

davide sofer
- 3
- 3
0
votes
1 answer
convert string[] to base64
I am opening a file encoded in base64 and I need to decode it
string[] lines = File.ReadAllLines(open1.FileName);
is there anyway to do this?
I have tried doing this.
string[] lines = File.ReadAllLines(Convert.ToBase64String(open1.FileName));

Eleventeen
- 1
- 2