Questions tagged [file.readalllines]

88 questions
0
votes
2 answers

"\n\r" String to Array C#

When I do a Reader.ReadToEnd() it returns \n\r , How do I convert that String into array without '\n\r' , Even better, how do I give a signal that \n\r is a new index in the array?
Zoki
  • 1
0
votes
1 answer

What's the fastest way of appending text from one file to another with huge files

So I have 5 textfiles that are 50GB each and I'd like to combine all of them into 1 textfile and then call the LINQ statement .Distinct() so that there are only unique entries in the new file. The way I'm doing it now is like so foreach (var file in…
JohnA
  • 564
  • 1
  • 5
  • 20
0
votes
2 answers

Reading file json and convert to string and replace chars in java8

How read file and convert from json to string? Example: i have file numbers.json [ "23423423", "234234234", "53453453" ] And i want to have: String numbers = "'23423423', '234234234', '53453453'";
svz
  • 23
  • 1
0
votes
1 answer

File.ReadLines keeps file locked after reading it and i can't write into it

For some reason File.ReadLines keeps the file that im reading locked, and when i am trying to write text into it using a streamWriter, i get an error that it is being used by another process. If i don't read it first, writing into it works fine.…
0
votes
1 answer

How to browse from bottom to top of a text file in vb.net?

I cannot get my code below to work correctly, in fact I want to press a back button in order to go up the lines one by one of a text file then I cut the chain into 3 parts. Dim LinesOfText() As String =…
claudebl
  • 55
  • 1
  • 6
0
votes
1 answer

Read text file line by line and store names into list in java

The task is to read the given file and return list of full names. I've separated the lines successfully and should be able to get both first and last names, but I'm a bit confused about how should I do that. How am I able to get full names from…
Meowz
  • 13
  • 2
0
votes
0 answers

Properly editing a text or source file from C#/.NET

The typical way to edit a text or source file from code is to read the file using File.ReadAllLines or File.ReadAllText, make your changes, and then write it out using WriteAllLines or WriteAllText. However, if you were to open the text file (say…
0
votes
1 answer

Parse date from file using java split

I have code that parses a file then inserts the rows into a table. I ignored the first row originally because it had just the date and useless data. I want to now take the date and insert it into all the rows in my table but don't know how to really…
0
votes
1 answer

Parsing Pipe delimited file and Storing data into DB using Spring/Java

I have a pipe delimited file (excel xlsx) that I need to parse for certain data. the data is all in column A. the first row has the date, the last row has the row count, and everything in between is the row data. I want to take the first three…
NormX
  • 115
  • 3
  • 19
0
votes
2 answers

File Read.AllLines, but can user select file from console application?

I am using C# and was wondering if there is a way to ask the user for a file name (in the console application) within the local documents. I don't really know how to structure this question when looking online but the code I have : static void…
GHOSTROBOT
  • 11
  • 2
0
votes
1 answer

vb.net readalllines fill form replace certain lines coding advice

What I'm trying to accomplish is reading a text file and selecting certain lines to modify by filling in text from a second form. Here is an example the code I'm currently using. What's happening is I'm looking for a line that starts with 718 and…
Nick
  • 155
  • 4
  • 16
0
votes
0 answers

file.read() output differences

I know there are a lot of questions about file.read() but I dont think any of them answer this.... Can someone tell me why, if I read a file with say 12 lines, in the interpreter and print it by just typing in filename.read(), it is presented on…
kaj0103
  • 1
  • 1
0
votes
2 answers

Use for-loop for loading consecutive (numeric) named files

I have a folder ("EDI") [editions] with .txt files inside (01,02,03,04) I have this functional code: ListBox2.Items.AddRange(File.ReadAllLines(Application.StartupPath & "\Cat\EDI\",…
arc95
  • 97
  • 1
  • 8
0
votes
1 answer

C# Cant find file (read from serial port)

I´m trying to open a file named the same as a bar code but I get the error that the file cannot be found? I use this line to read the file: string[] DxfFile = System.IO.File.ReadAllLines(textBoxBarCodeScanner.Text); It works fine and open the file…
JeeyBee
  • 21
  • 1
  • 8
0
votes
2 answers

Best solution to read or write multiple data from or into various forms using c#

My problem is to save and read the file. Can u suggest the best way to save the data(mostly numbers) from various forms into a data file (can be .txt, .dat etc) and then read a specific data from the file... For example.. I write: Data 1 Data…