-- split: transforms a pseudo-2D spectrum into an array of independent documents -- you NEED to REDEFINE: local FOLDER = "/Users/_your_account_/Desktop/split/" -- the folder where the new spectra will be saved os.execute('mkdir "'..FOLDER..'"') -- creates the folder local spec = getf("y") -- gets the parameters for the 2D spectrum local step = spec.width / spec.size -- difference (in ppm) between two rows local y = spec.start + spec.width - (step / 2) -- the frequency of the bottom row for i = 1, spec.size do -- loop over the rows mark( "h", y ) -- selects a row extract() -- extracts a row export( FOLDER..i ) -- exports it into a new file called 1, 2, 3... closex() -- closes the extract y = y - step -- frequency of the next row end