|
Answer» Hello everyone. I can tell you now that I'm a complete NEWB to this.
I have a .exe file that reads a .raw file from a laboratory machine. The .exe file works just fine: you tell it what file to read then tell it what record to read in the file, and it displays the data. The .raw file contains 350 records, each record contains 1000 rows of data. I can get all the data I need by manually feeding the .exe file the numbers 1-350 BUT I would like this automated through a BATCH file. This is what the batch file looks like now:
*RUN read-raw.exe < input.txt >> results.txt
The input.txt file looks like this:
hao01.raw 1 2 3 4 0
The problem is, when I run the batch file, the results file generated only displays the first record, and doesn't even complete the record by displaying all 1000 rows. It displays up to 998 just fine, and only display a "1.0" for the 999th row (which is not the correct data values).
Can anyone help me out? I just noticed that it's giving the first 3 characters for the 999th row. So "1.0" was actually the correct value, but it just cuts off after that. I tested it with record 2 and it does the same thing, runs properly through row 998 and gives the first 3 characters of row 999.
What could be causing it to cut off after the first three characters on that 999th row?No ideas? it could be that fact that notepad has a limited number of character per row, and you're exeeding it, but i'm not sure if a batch file would continue WRITING in the next line (WORD wrapping). I suggest making a loop that writes a character a number of times (a large number of times) to the file....
but the echo command goes to the next line after execution, so maybe making a long string with a loop and writing it to the txt file would work.
I havn't tested this, but playing AROUND this idea might get you somewhere
Hope this helps
regards Two-Eyes %
EDIT/UPDATE: I tried this, and word wrapping DOES occur, so now i'm stumped. Maybe It's the code in the read-raw.exe file... do you have access to it? A more informed person than me might help you better...need to know what is the 4th character of row 999. Two-eyes, I'm trying to see if I can get the code for the read-raw.exe now. I'll post it if I can get it. But I wonder could that really be the problem if the read-raw.exe works perfectly when it's fed in the row #'s individually, by hand?
Salmon Trout, the 4th character of row 999 for record 1 is a "4". Well actually the rows displays "999 1.0" so I guess it technically cuts off after the 7th character. (The 999th row in it's entirety should read "999 1.048 0.697 155.93")
But it's cutting off at that point on any record I select. For example, if I have the input file start with record 2 The last line displays "999 0.6". When the full row should read "999 0.624 0.278 30.00".
Thanks so much for your help.
Another question: How is a batch file supposed to close out on it's own? This thing doesn't close on it's own, I have to close it and click "End Now." It just seems like it should close on it's own. I wait for a while before I close it, to try and let it finish, but it doens't matter how long I wait; it still hangs up at the same point. Could this be realted, or no?Quote the read-raw.exe works perfectly when it's fed in the row #'s individually
woops, didn't get that part in your first post, sorry. So my "fix" wouldn't be related.
QuoteI'm stumped
I just checked and I can't get the code for the .exe anyway.
Anyone else have other ideas?Quote from: Salmon Trout on October 20, 2009, 01:41:34 PMneed to know what is the 4th character of row 999.
|