read

Linux shell command to read/print file chunk by chunk

Hi All, Is there a standard Linux command i can use to read a file chunk by chunk? For example, i have a file whose size is 6kB. I want to read/print the first 1kB, and then the 2nd 1kB ... Seems cat/head/tail wont work in this case. Thanks very much. ...

D (Tango) Read all standard input and assign it to a string

In the D language how I can read all standard input and assign it to a string (with Tango library) ? ...

Read from Console in F#

Does anyone know if there is a builtin function for reading from the console likewise to the printfn function? The only method I've seen so far is using System.Console.Read() but it doesn't feel as functional as using a construct like printfn is. ...

Go to a specific line in python?

i want to go to line 34 in a .txt file and read it how would you do that? In python? ...

Read/Write Excel Files Directly To/From Memory

Several people have asked, in a roundabout way, but I have yet to see a workable solution. Is there any way to open an excel file directly from memory (like a byte[]) ? Likewise is there a way to write a file directly to memory? I am looking for solutions that will not involve the hard disk or juggling temporary files. Thanks in adva...

How the reading from and writing to sockets are synchronized?

We create a socket. On one side of the socket we have a "server" and on another side there is a "client". Both, the server and client, can write to and read from the socket. It is what i understand. I do not understand the following things: If a server reads from the socket, does it see in the socket only those stuff which was written ...

How to read STDIN into string variable until EOF in C?

Hi, im getting "Bus Error" trying to read stdin into a char* variable. I just want to read whole stuff coming over stdin and put it first into a variable, then continue working on the variable. My Code is as follows: char* content; char* c; while( scanf( "%c", c)) { strcat( content, c); } fprintf( stdout, "Size: %d", strlen( content...

How can I walk through two files simultaneously in Perl?

I have two text files that contain columnar data of the variety position-value, sorted by position. Here is an example of the first file (file A): 100 1 101 1 102 0 103 2 104 1 ... Here is an example of the second file (B): 20 0 21 0 ... 100 2 101 1 192 3 193 1 ... Instead of reading one of the two files in...

SHAREPOINT 2007 - Record Read Only

Hi All, In a "Issue" list, I have a mandatory field called "Status", to control the status (Identified, implemented, postponed, etc.). I need to control the behavior of each record based on that field content. For certain status the record should became read only, and only admin users should be able to edit / change it. Is there a way t...

Writing/Reading struct w/ dynamic array through pipe in C

I have a struct with a dynamic array inside of it: struct mystruct{ int count; int *arr; }mystruct_t; and I want to pass this struct down a pipe in C and around a ring of processes. When I alter the value of count in each process, it is changed correctly. My problem is with the dynamic array. I am allocating the array as such: mys...

PHP - Read number of dirs and then require for each a specified file name

Hello, I want to make a little script but I'm rather n00b in php so please help me if you can :) What I want the script to do is: I have "index.php". I want "index.php" to read the sub-directories from a known folder, let's say "templates/" Each sub-directory will contain a file called "content.html". The index will then load the "co...

PHP Read xlsx Excel 2007 file

I am using oleread to read uploaded xls file. But I am not able to read xlsx files saved in excel-2007 format. can someone help me on how to read xlsx file in PHP. ...

Max file size for File.ReadAllLines

Hi, I need to read and process a text file. My processing would be easier if I could use the File.ReadAllLines method but I'm not sure what is the maximum size of the file that could be read with this method without reading by chunks. I understand that the file size depends on the computer memory. But are still there any recommendations ...

how to read character from console in c++?

I'm struggling with reading characters from console in c++. Here is what I tried to do: char x; char y; char z; cout<<"Please enter your string: "; string s; getline(cin,s); istringstream is(s); is>> x >> y >> z; The problem is if the user enter something like this "1 20 100": x will get 1 y will get 2 z will get 0 What I want t...

read a line in java

i want the easiest way to read a line in java. after that i want to tokenize it. ...

Socket Read In Multi-Threaded Application Returns Zero Bytes or EINTR (104)

Hi. Am a c-coder for a while now - neither a newbie nor an expert. Now, I have a certain daemoned application in C on a PPC Linux. I use PHP's socket_connect as a client to connect to this service locally. The server uses epoll for multiplexing connections via a Unix socket. A user submitted string is parsed for certain characters/words ...

How to read excel file in vb.net 2003

Can anyone help me on how can I read the excel file using vb.net 2003? The first thing to do is to browse the excel file in my vb.net program then read the content of excel file and display the value of excel content in listview. ...

Reading a .dat file as "rb" read binary

I have a folder \folder\ above the webroot that contains .php, .inc, .dat files the .php can access the .inc no problem but when the .inc tries to access the .dat using fopen('mydat.dat', "rb"); it gives an error that it can't find mydat.dat inside \folder\myinc.inc Of course it can't find it since .inc is a file not a folder. Why i...

importing C written binary files into Matlab

Hi, I've read the post "Read and write from/to a binary file in Matlab" but I still have doubts. I have a binary file of long double values created with fwrite in C and in Matlab I'm using fid = fopen('vz3.dat', 'r') mydata = fread(fid, 'double') where vz3.dat is my file. But I'm getting garbage values in Matlab. According to [ci...

How to save memory when reading a file in Php ?

I have a 200kb file, what I use in multiple pages, but on each page I need only 1-2 lines of that file so how I can read only these lines what I need if I know the line number? For example if I need only the 10th line, I don`t want to load in memory all the lines, just the 10th line. Sorry for my bad english! ...