read

How to read the contents of .doc file into string in XCode?

How do I read the contents of .doc file [not from resource file] into NSString in Objective-C? I tried doing it in this way: NSString *str = [NSString stringWithContentsOfFile:@"/User/home/Documents/config.doc"]; NSLog(@"Contents of file : %@",str); OUTPUT: -+-% [encoded format] output is in encoded format How do I solve this probl...

Read whole text file into matlab variable at once

I would like to read a (fairly big) log file into a matlab string cell in one step. I have used the usual: s={}; fid = fopen('test.txt'); tline = fgetl(fid); while ischar(tline) s=[s;tline]; tline = fgetl(fid); end but this is just slow. I have found that fid = fopen('test.txt'); x=fread(fid,'*char'); is way faster, but i ge...

iPhone: Reading many images quickly

I've got an app I'm working on where we handle a LOT of images at once in a scrollview. (Here's how it looks, each blue block being in image on a scrollview expanding to the right: http://i.imgur.com/o7lFx.png) So to be able to handle the large strain doing this puts on memory. So I've implemented a bunch of techniques such as reusing im...

Python error "IOError: [Errno 2] No such file or directory" but file is there

I am trying to read a csv file and I am getting the error above but the file is there. The line giving the error is infilequery = file('D:\x88_2.csv','rb') and I get the error below. Traceback (most recent call last): File "C:\Python26\usrapply_onemol2.py", line 14, in infilequery = file('D:\x88_2.csv','rb') IOError: [Errn...

Selecting and printing specific rows of text file

I have a very large (~8 gb) text file that has very long lines. I would like to pull out lines in selected ranges of this file and put them in another text file. In fact my question is very similar to this and this but I keep getting stuck when I try to select a range of lines instead of a single line. So far this is the only approa...

BASH: read in while loop

while [ $done = 0 ] do echo -n "Would you like to create one? [y/n]: " read answer if [ "$(answer)" == "y" ] || [ "$(answer)" == "Y" ]; then mkdir ./fsm_$newVersion/trace echo "Created trace folder in build $newVersion" $done=1 elif [ "$(answer)" == "n" ] || [ "$(answer)" == "N" ]; then $done=2 else echo ...

How to read data in chunks from notepad file in Matlab?

My data is in following format: TABLE NUMBER 1 FILE: ReservoirModel_CMGBuilder.irf WELL: Well-1 TIME Oil Rate SC - Yearly day bbl/day -0.01 0 364.99 35368.4 729.99 29307 1094.99 27309.5 1460.99 26058.8 1825.99...

How to timeout a read on Java Socket?

I'm trying to read items from a socket and I notice that if there is nothing on the stream of the socket it will stay at the read and back up my application. I wanted to know if there was a way to set a read timeout or terminate the connection after a certain amount of time of nothing in the socket. ...

On site load: "Cannot read .htaccess"

Hi, I'm trying to get my website back online after recovering from an XSS attack. At the time of the attack, I set all the file permissions to 400 to take the site offline. I left it that way for a few days, and then ended up deleting all the files in the var/www/ directory and uploading a full backup of the site. The backup had screw...

JDBC & MySQL read performance

Hey, I really seem to have a big problem here. I'm using MySQL to store part-of-speech tagged sentences in a table. The Table looks like this: +------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+------------------+------+-----+---------+-------+...

Monitor File for Read and Change Data?

Is there any way, using C#, to monitor a specific file then change its contents before it is read by specific applications? Here is the situation: I have a Windows 2003 Server running ASP.NET with a configuration file (xml) which contains LDAP information. I want to have the LDAP password encrypted. I'm trying to devise a way to monit...

Reading other's code...

Possible Duplicate: How do I begin reading source code? I've been studying C++ and Lisp for a while now.. Bur, everytime I try getting others code to read. WOW, it seems like I am very very lost. Anything has some tips? thank you, Mario ...

How to read data from a repeated format of a large text file in MATLAB?

I want to read data of average saturation (%) for water as shown below. This data is a partial form of a large file, however the average water saturation (%) REPEATS itself in the given format only. Average Pressure Total Pore Volume psia 3884.9 ...

java inputStream Freezing

Im trying to run a thread that goes to a socket, grabs the input stream, and reads it. Im creating hundreds of these threads and have set the timeout for reading and yet the thread still stays at the read() line. public void readPack() { socket.setSoTimeout(4*1000); if (socket.isConnected()) { buffer parse = new buffer(); ...

Read content of 12000 files from another FTP server

What I would like to script: a PHP script to find a certain string in loads of files Is it possible to read contents of thousands of text files from another ftp server without actually downloading those files (ftp_get) ? If not, would downloading them ONCE -> if already exists = skip / filesize differs = redownload -> search certain st...

other problems with data acquisition from MATLAB

3 days ago I asked for help in acquiring data from a text file generated by a C program (. Exe). Thanks to the programmer "second" I solved the problem but yesterday I discovered that the output file is more complex than I had expected. I also ask you help. The file output is: V|0|0|0|t|0|1|1|4|11|T4|H13|||||||||||| P|40|0.01...

Combining read operations in SMB

I have an application that reads from a very large binary file. It never has to read the whole file, only small parts of it, which are spreaded accross the file. For example, in VB6 code: ReDim Data(26) as Integer Get #1, 2536, Data ReDim Data(79) as Integer Get #1, 13504, Data ReDim Data(51) as Integer Get #1, 39827, Data Etc.. Fo...

Python - Regular Expression Wildcards from Socket data?

Hello everyone. I have a question regarding regular expressions in Python. The expressions are composed of data that would be read from a server, connected via socket. I'm trying to use and read wildcards in these expressions. Example: Let's say I run a chat server. When a message is recieved, the server sends to all clients (JSmith send...

select() doesn't wait

Hi, I've to read program log file and to do that I wanted to use select() and read() #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/select.h> #include <fcntl.h> #include <stdio.h> int main() { int fd = -1; fd_set fds; struct timeval tv; int rc; char buffer[4096]; char * log_path = "/...

how much time a programmer need to completely read their books.

i am in trouble then how many time i need to Read a book completely. in my own way i read very slowly [other tell me that i am very slow]. are any way to read a book completely. when i read some chapter of books then my focus from book are lose [i see it many times] ...