Kennedy thanks! That worked.
vic
Type: Posts; User: victor_miami
Kennedy thanks! That worked.
vic
I am printing to a file and have the following problem that I can't seem to fix. When I print out the results the last two fields are skewed because of the differnet lengths of the names that get...
very similar to what I have implemented. You have taught me a lot! I appreciate all the help. I know there is an area for book recomendations. Can you recommend a good C book?
Thanks!
Dave,
The file will be a text file. I don't know if it will make a difference if the values are written out as float or char type? Does it make any difference? Another process will eventually open...
The "value" variable is a double (please see the code below). Is there a way to assign this to an array of float type variable? (i.e. - var_value[10][1600], where 10 can be up to 10 different...
Dave,
Thanks! Much appreciated.
Quzah thanks! What ever happened to "Hammer"? I don't see his/her posts any longer.
Dave,
I used it and it worked as you said. Thanks! I have some questions as to some of the fields you implemented in the sscanf function.
you used the following:
sscanf(text, "%19s%n",...
Dave,
I'm sorry. I am a dummy for not recognizing the quality post. I will study the example you gave me and learn from it. I think I just reached a point of frustration and tiredness and was not...
The data format looks like this (except there can be up to 1800 data points
(ie - 9 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45...... ).
time
9 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5
9.55...
Quzah,
If I have 20 variables that I need to keep track of and each variable can have up to 1800 data points, how should I size the array. Can you explain? I greatly appreciate your help. Thanks!
here is the section of code I have.
int i=0;
float fltread;
float var_data[10][1800];
while (fgets(s,sizeof(s),f)!=NULL) //read the lines of var data
{
No the trailing zeros are ok. I also need to be able to detect when the data ends as shown in the example of the data I used. The data needs to be read into an array of variable data for up to 100...
happy...look at the data, some of the data is integer data.
OK I understand that but I'm not sure if it stops when it hits a non number. There are two issues I need to solve. One is reading integers and reals from the same line. The other is to know when to...
OK I'm clueless on how to do this. I can setup the reading of each line of data using fgets but I am not sure how to set sscanf to read the intergers and real numbers, and then to stop reading when...
Dave thanks for your reply. I fixed that problem. See earlier reply. I'm not looking for anyone to write my code for me. I need help figuring out which c lib functions are appropriate to solve the...
any help is sincerely appreciated.
Sorry about that. I set it up by opening another file with a variable name list such as:
var1 var2 var3 ...var(n). I use sscanf to read each variable name into an array of variable names. I...
I fixed that problem. Sorry it was a stupid mistake I should have caught in the first place. I have another problem. What is the best way to read/store data that is in the following format?
var1...
I'm having trouble reading a data file's data using sscanf. The format of the data file (called file.txt) looks like this:
NUMBER OF PARAMS 249
TITLE BLOCK
B211W111
444-565AG
FIGURE 3.6-1a...
Thanks for the links but I still don't see how these answer the question of finding a string within a string. Can anyone provide an example (code) of searching for a string within a string?
I...
I have a text file that I need to read.
The text file looks like this:
CARDATA
redcars.dat type_1.2-1 speed acceleration inertia
blackcars.txt type3.4.44-112 weight length wheelbase engine...