insertwords = regexp(insert, '\s+', 'split');
tfile = tempname();
fid = fopen(tfile, 'wt');
fprintf(fid, '%s\n', insertwords{:});
fclose(fid);
system( sprintf('%s < "%s"', 'gridconv.exe', tfile);
delete(tfile);
This presumes that every "word" should go on a different line. If that is not the case then you need to use a delimiter between the parts and code that delimiter in the regexp, or you need to code the lines using a cell array of strings.
