1. ## read file: from, if

Hi!

I have large log file with tables - heres a short example:

33 1 1 1 1 1.000 0/0 0/0 0.000 1.000
36 1 1 1 1 1.000 0/0 0/0 0.000 1.000
39 1 1 2 2 0.500 0.000 0.000 0.500 0.750
42 2 2 2 2 1.000 0/0 0/0 0.000 1.000
43 2 2 2 2 1.000 0/0 0/0 0.000 1.000
(numbers should be aligned)

program should read first number (up to 5digits) in line if it satisfies a certain condition - 4digit number in the same line as number to test (0.500-TRUE, 0.000-FALSE)

How can i put in this condition?

2. maybe a little more elaboration, but ill take a stab
at it.

if the number will always be where you expect them you can just
ignore the number until you read the one you want,
then a simple if statment, such as
Code:
`if(number == 0.500) { // do this }`
where of course number is a double or float
if your dont know for sure what number
it will be but all you need to do is know
if its larger then 0 you could do

Code:
`if(number > 0) { // do this }`
if you could be a little clearer on what you need accomplished,
possibly post code you already have i wills tick around
till we get your problem solved.

3. thanks, havent thought of that!

i just started (2 weeks ago) to learn to program and i dont know exactly how to make this program - i havent made a code - yet. i have an idea what steps should it make, so i know what to look for - exept for that problem...

thanks again

4. read file: from, if
program should read first number (up to 5digits) in line if it satisfies a certain condition - 4digit number in the same line as number to test (0.500-TRUE, 0.000-FALSE)
If you ever need a recommendation to apply for a job as a Navajo code talker, let me know.

5. if I get Mel Gibson to protect me, yes please!

ok, I`ll try again (to practice)...
My program should: open a file; read numbers (N) from the begining of a line to first space; check for condition, which is in the same line columns 58-62; if condition True write N to another file (or on screan); procced to next line;

hope thats better.

Can you recommend me some book for a begginer ( is Pratas C++ Primer Plus Ok?)

Popular pages Recent additions