Exporting as fixed field text file
maru
I am using an old Fortran code, and it only accepts fixed filed text files.
Is it possible to export data from Igor as fixed field text? I found the importing function but could not find the export version.
I didn't find that option either after a quick look. I am sure the Igor staff has something to say about this, but if all things fail, you always have the option to format the output string yourself and then use fprintf to write formatted lines to a text file.
April 11, 2022 at 09:41 pm - Permalink
My first guess is that Save should support that, but doesn't look like it. In that case wfprintf should do the trick.
April 12, 2022 at 01:19 am - Permalink
Thank you very much! fprintf works perfectly. The printed text is right-aligned by default and fits the Fortran format. I did not try wfprintf yet, but I guess it will work fine as well.
April 12, 2022 at 05:38 am - Permalink
The only difference is that wfprintf reads the values from a wave, while for fprintf the values come from single strings / variables. If your data is stored in a wave and you just want to export the full contents without much fuss, then wfprintf may be the way to go.
April 12, 2022 at 08:47 am - Permalink
I will use fprintf to input the header and wfprintf for the data part. Thank you again.
April 12, 2022 at 04:36 pm - Permalink