reading-files

Overwite Line in File with PHP

What is the best way to overwrite a specific line in a file? I basically want to search a file for the string '@parsethis' and overwrite the rest of that line with something else. ...

Using WPF Imaging classes - Getting image dimensions without reading the entire file

Hi guys Link this post I want to be able to read an image files height and width without reading in the whole file into memory. In the post Frank Krueger mentions there is a way of doing this with some WPF Imaging classes. Any idea on how to do this?? Cheers Anthony ...

Is there a more efficient way of reading a formatted file in C than I have done?

Hi, I need to read in a formatted file that looks something like this. Code: HARK Name: Oscar MRTE: Train etc At the moment my code looks like this. FILE *file; char unneeded[10]; char whitespace[2]; char actual[10]; file = fopen("scannertest.txt","r"); fscanf(file,"%s",unneeded); // this is the identifier and the colon (code:) fs...

Performance of Reading from a file vs. an ArrayList

I have to use a thousands of data read off from a file, and use the data hundreds of times repetitively in order to train and test my AI algorthm. Right now, I have two possible solutions. One is to keep reading off directly from the file everytime I need to use the thousands of data. The other one is to read off from the file and store...

PHP: Fastest way possible to read contents of a file.

Ok, I'm looking for the fastest possible way to read all of the contents of a file via php with a filepath on the server, also these files can be huge. So it's very important that it does a READ ONLY to it as fast as possible. Is reading it line by line faster than reading the entire contents? Though, I remember reading up on this som...

How to get the Entire Function from a file

Ok, I'm reading through a file now, line by line. I know each functions name in the file, since it is defined elsewhere in an XML document. That is what should be this: function function_name Where function_name is the name of the function. I get all of the function definitions from an XML document that I already have put into an a...

how to read data from file into array? java

I need some help reading data from a txt file into my ArrayList. I know the code is pretty messy, but just try to take a look at it. The first part with the creating and putting the ArrayList into the txt file works perfectly. I just need some help at the end in the "marked" area. Sorry if I still have some words in my native language...

Reading a text file in Java

I want to read a text file containing space sepearted values. Values are integers. How can I read it and put it in an array list? Here is an example of contents of the text file: 1 62 4 55 5 6 77 I want to have it in an arraylist as [1, 62, 4, 55, 5, 6, 77]. How can I do it in Java? ...