Re: How to batch-process data files
On Thursday 10 July 2003 16:44, David Z Maze wrote:
> Joerg Johannes <firstname.lastname@example.org> writes:
> > I thought that the text and the dashed line would confuse gnuplot,
> > but they are just ignored. Thanks, Nick, and sorry for the noise...
> > (Anyway, it would still be interesting how to just comment out the
> > first six lines of text...)
> I'd use "sed -e '1,6s/^/#/'" -- "on lines one through six, replace
> start-of-line with a pound sign". You'd need to go through the
> normal sed contortions to make it replace the original files, though.
> You could also use "sed -e 1,6d" or "tail +7" to discard the first
> six lines.
for i in *.txt; do sed -e '1,6s/^/#/' $i > `echo $i | sed s/.txt/-proc.txt/`; done
This does the job. Thanks to all
Gib GATES keine Chance!