Fabio Zyserman wrote:
What I want to do is to create a new file, with one line from each of the data files (say, line beginning with 0.01e00), adding to each line in the new file the number appearing in the name of the corresponding data file. That is, the new file will contain one more column than the original ones; the new file would be 0.01e00 .... .... .... 1.2 0.01e00 .... .... .... 1.3 0.01e00 .... .... .... 1.4
rm -f newfile for i in `ls data-*` do ls $i printf `cat "$i" | grep -i "0.01e00"` >> newfile printf ".........." >> newfile printf `basename $i | cut -d = -f 3` >> newfile printf "\n" >> newfile done well.. you get the idea. --Adrian. - To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html