I have a txt file with numbers like 541399.531 261032.266 16.660 (first line) 541400.288 261032.284 16.642 (2nd line)........hundred of points. i want to convert this file i
I suggest avoid writing the binary representations to a file for a few hundred or thousand points. This is called a micro optimization and the development time outweighs any gain in performance of the executable.
In current computing, most platforms support huge (gigabyte) file sizes and computers have megabytes or gigabytes of memory for programs to use. So writing in binary for saving room (file size or memory size) doesn't gain any significant advantages compared to other bottlenecks in the development cycle.
The idea that loading a binary representation from a file is more efficient than translating a textual representation is true. However, most processors can translate an ASCII translation faster than the binary data can be read in. Summary: the time gained by removing the translation is overshadowed by bigger consumers of time such as file I/O, and context switches.
More applications can process textual representation of floating point numbers than the binary representation. With a textual representation, the data can be easily used in spreadsheets, word processors and analysis tools. Files containing the binary representations require more effort. When was the last time you tried reading a file of binary floating point numbers into a spreadsheet? Don't under estimate the future potential for data files.
Changing data representation is a form of optimizing. The rules of optimizing (in order of importance) are: