Questions tagged [file.readalllines]

88 questions
-1
votes
1 answer

Issue with conditional statement on external python file

I created this script that could be used as a login, and then created an external text file that has the data 1234 in it, this is attempting to compare the data from the file, but outputs that the two values are different, even though they are the…
profound.donut
  • 33
  • 1
  • 3
  • 8
-1
votes
1 answer

io.file.Readalllines works for one file name but not for anyothers also does not throw exception on invalid filename

The files I am trying to read are in a file called systemstate in the bin\debug file. I have a text file call systemdetails in that file and a file in there called Products and a file of products called P0 containing the rest of the text files in…
adeel
  • 7
  • 4
-1
votes
1 answer

vb.net edit a file based on criteria and save it

I have a file that has dates and results of tests, written line by line. I would like to edit the file such that any line that does not have today's date is deleted and then the file is saved (with the unwanted lines deleted). Help will be greatly…
MordC
  • 61
  • 3
  • 11
-1
votes
1 answer

VB 2012 - StreamReader not closing

This is a real head scratcher. According to all documentation, file.readAllLines should close the file it's reading from after it completes. But in my app, when I try to write to the file, it throws an IO exception saying "process cannot access the…
Rocks
  • 107
  • 2
  • 12
-1
votes
1 answer

List values are not being stored

Can someone please tell me what I'm missing, the class reads values from a text file and should store them for other use, I can see the values with Console.Write(eachCell[0]) but I can't save the values. I've tried using string[] and List
-1
votes
1 answer

C# Array strings in a Group of Radio Buttons

My code is C# windows form I have a file with data: David One And Two/Three Alex One Two Four And Five/Six Amanda Two Seven/Ten Micheal Seven/Nine and trying to have them in array like string[] Names =…
Jonas Willander
  • 432
  • 3
  • 9
  • 29
-1
votes
1 answer

Getting error on files.readAllLines

I am working in android. For reading the file content, I am using the method List lines = Files.readAllLines(wiki_path); But whem I am using this method I am getting this error: The method readAllLines(Path) is undefined for the type…
sheetal. gami
  • 47
  • 1
  • 10
-1
votes
3 answers

Read Lines from textfile in assets to array

I am using the following code to read a text file from the Assets Folder into a string and the split it into array string filepath = @"Assets\DATA.csv"; StorageFolder folder = …
Mark Barr
  • 159
  • 2
  • 12
-1
votes
2 answers

How can I remove the oldest lines in a file when using a FileStream and StreamWriter?

Based on Prakash's answer here, I thought I'd try something like this to remove the oldest lines in a file prior to adding a new line to it: private ExceptionLoggingService() { _fileStream = File.OpenWrite(GetExecutionFolder() +…
-2
votes
2 answers

Search multiple words in a text file

I made a code to search for several words in a text file but only the last word is searched, I would like to solve it code: string txt_text; string[] words = { "var", "bob", "for", "example" }; StreamReader file = new…
vitem
  • 15
  • 6
-2
votes
1 answer

Write to File skips last 10-20 lines

First i Read all lines of a text file line by line and store it in a string-array. Then i write it with file.WriteLine() into a file. The opened Console window shows every line which was written into the file, but when i open the file to check if it…
Phil
  • 19
  • 4
-2
votes
2 answers

Creating a Java.util.List from an existing .txt file 'FIXED'

I'm trying to create a java.util.List from an existing .txt file, when the list is created and filled with the java.util.String from the .txt file I would like to print it to the console to test if the List is filled. I have tried a lot but I always…
-3
votes
1 answer

Read all lines to string[] until next sign is found

I'm trying to read one textfile (one line per entry, separated by two "enums" used as attribute, see example). [enum1_0][enum2_0] line line [enum1_0][enum2_1] line line [enum1_1][enum2_0] line line [enum1_1][enum2_1] line line I want to create a…
ag4w
  • 1
  • 3
1 2 3 4 5
6