Re: need help with a bash script

"Adrian C." <[email protected]>
Newsgroups gmane.linux.admin
Message-ID <[email protected]>
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.