>> do i 1 8 Enter commands to do, line at a time, EOF to finish insert >> g-s-f-m i insert >> wr-sp 1 insert >> Filed as scan 31 of junk Filed as scan 32 of junk Filed as scan 33 of junk Filed as scan 34 of junk Filed as scan 35 of junk Filed as scan 36 of junk Filed as scan 37 of junk Filed as scan 38 of junk >>Using the variable i as a simple counter, I read the series of spectra from the map and write then to file number 1. Because there are already spectra in this file, the scan numbers increment from the previous last number.
I mentioned that the in-line do loop is used only once. However, that's not necessarily true. Such a command file leaves a record of itself in a file called temp.spx. Naturally Unix overwrites this file every time a new version is created, so if you wanted to keep such a file you would have to rename it. The version of temp.spx created by the preceding simple do loop looks like:
do i 1 10 1 g-s-f-m i wr-sp 1 enddo return >>This routine could be re-used by simply typing
>> @temp
In-line do-loops are really quite useful. It's up to your imagination what you use them for.
Specx Cookbook Reduction of millimetre wave data