Re: Writing a modified .txt file issue [message #85387 is a reply to message #85384] |
Tue, 30 July 2013 03:38   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Tuesday, July 30, 2013 2:49:58 AM UTC-4, Ahmet Hakan BAYRAK wrote:
> And this is my output file: output.txt: In the output file I didn't remove header to show how it doesn't match.
Why don't you think that they match? Is it because the output file has numbers like 8.2000 while the input file has 8.2? You gave an output format of F12.5 which is why the output has 5 digits after the decimal point. As Phillip wrote earlier
*******************
For the output, Hakan, I would say those numbers *do* match, although they might be formatted differently. You'll want to use the FORMAT keyword, however you're writing the file back out if you want to match the numbers/decimal places/etc.
A simple example:
IDL> a = 13.2
IDL> PRINT, a
13.2000
IDL> PRINT, a, format='(F5.2)'
13.20
IDL> PRINT, a, format='(F4.1)'
13.2
You would do something similar using PRINTF.
*******************
Or is there some other reason why you think that the output doesn't match the input?
|
|
|