read

how to tokenize string to array of int in c?

Anyone got anything about reading a sequential number from text file per line and parsing it to an array in C? What I have in a file: 12 3 45 6 7 8 3 5 6 7 7 0 -1 4 5 What I want in my program: array1[] = {12, 3, 45, 6, 7, 8}; array2[] = {3, 5, 6, 7}; array3[] = {7, 0, -1, 4, 5}; I've been through several ways to read it, but the ...

using sscanf(), read string to array of int?

i have this string: 12 4 the quick 99 -1 fox dog \ what i want in my program: myArray[] = {12, 4, 99, -1}; how i do a multiple number scanning? ...

Comet, Tomcat and READ events

Trying to get my way trought Comet with Java servlets, I encountered a big problem: There seems to be no way to use the established connection to the client to send the server additional data from the browser (works in plain java when writing to the inputstream). Following problem arises for a CometChat application when a Client connect...

Reading data into MATLAB from a textfile...

I have a textfile with the following structure: 1999-01-04 1,100.00 1,060.00 1,092.50 0 6,225 1,336,605 37 1999-01-05 1,122.50 1,087.50 1,122.50 0 3,250 712,175 14 ... The file contains repeated sets of eight values (a date followed by seven numbers, each on their own line). I want to read it into MATLAB and get the values into diff...

Reading line by line

I have a program that generates a plain text file. The structure (layout) is always the same. Example: Text File: LinkLabel "Hello, this text will appear in a LinkLabel once it has been added to the form. This text may not always cover more than one line. But will always be surrounded by quotation marks." 240, 780 So, to explain wha...

read string from .resx file in C#

Hi How to read the string from .resx file in c#? please send me guidelines . step by step ...

Comma Separated Value Files (Read/Write) - C#

Hey all, I've been very interested in CSV files for a few years now, but I never needed to use them until now, so I'm pretty new to this. I have an application that stores information about Controls that were created by the user at run-time. I plan on using CSV files to store this information which will be extracted at a later date by ...

How to change read attribute for a list of files?

I am powershell newbie. I used a sample script and made substitute from get-item to get-content in the first line. The modified script looks like below: $file = get-content "c:\temp\test.txt" if ($file.IsReadOnly -eq $true) { $file.IsReadOnly = $false } So in essence I am trying to action items contained in test.txt stored as UNC pat...

Convert string to font & Color

Can somebody please help me with a regex (or something else), I'm really struggling to get this done and can't find anything anywhere that helps me to finish it. I have a program where the user places some controls on a form. and when they click the save button it goes through all controls on the form and saves their details to a text f...

Wanted: DB for fast read operations to be accessed from ruby apps

Basically it's a financial database, with both daily and intraday data (date,symbol,open,high,low,close,vol,openinterest) -- very simple structure. Updates are just once a day. A typical query would be: date and close price of MSFT for all dates in DB. I was thinking that there's got to be something out there that's been optimized for...

Read Excel in editable gridview in asp.net 3.5

Hi, I can able to read the Excel sheet in grid. but I have grid that have textboxes & dropdown list (in template field -> itemtemplate ->Text box) . I want to be take data from Excel file in respective cell (textbox) of grid. Like we can take data from database by Eval() , is there any way to get such functionality? One think i know th...

Getting RGB values for each pixel from a 24bpp Bitmap in C

Hello, i want to read the RGB values for each pixel from a .bmp file , so i can convert the bmp into a format suitable for gba . so i need to get just the RGB for each pixel and then write this information to a file. i am trying to use the windows.h structures : typedef struct { char signature[2]; unsigned int fileSize; u...

OpenCV can't read image!

I am using this code: #include <stdlib.h> #include <stdio.h> #include <math.h> #include <cv.h> #include <highgui.h> #include <cxcore.h> #include <cxtypes.h> int main(int argc, char* argv[]) { IplImage* img = cvLoadImage( "dow2oc8.png" ); cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE ); cvShowImage("Example1", img); cvWaitKey(0); ...

Read bytes from string as floats

I've got a python webserver where small binary files are POST:ed. The posted data is represented as strings. I want to examine the contents of these strings. But to do that, I need to convert each 4 bytes to floats (little endian). How do you do that? ...

Read a Device in GNU/Linux or FreeBSD.

I am wondering, do you need a specific device driver to read a usb device in Linux, or should it just be able to be read. If I connect my cell phone or iPod touch to my linux box, it is not found is /proc/partitions and thus is not a mountable device by fdisks standards, though gnomes nautilus does in fact mount the iPod but not the win...

How to get File within' package, in an Android application

I'm am creating an Android application, but in order to have one of the functionalities working I need to read a predefined xml file whilst only knowing its name, not the R.id.. In normal Java I know I can use getClass().getClassLoader().getResource(xmlName) but using the limited Android SDK thats not working, any knows how to solve ...

Fortran read from char(len=15) array(dimension(1:77)), to char string (len=15)

how do I read from an array into a user defined variable... in Fortran? ...

Variables magic and read from file

Assume, i got the following file (input.txt): name = "Peter" age = 26 family_status = married Mentioned lines can be stored in a random order, lie: family_status = married name = "Peter" age = 26 In my program I also have variables family_status, age and name. How do I in a single cycle read those lines from file and assign corresp...

How to read exactly one line?

I have a Linux file descriptor (from socket), and I want to read one line. How to do it in C++? ...

programs running in parallel, read/writing in C

I'm considering a set of 4 programs: (Prog1, Prog2, Prog3, Prog4) interacting with 4 files (FileA, FileB, FileC, FileD) Prog1: writes (appends) to FileA Prog2: reads File A and writes (appends) to FileB Prog3: reads File A, and writes (appends) to FileC Prog4: reads File B, and writes (appends) to FileD or Potentially Prog1, might al...