Filemanagement

Chris F.A. Johnson c.f.a.johnson-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Sun Mar 7 19:33:47 UTC 2004


On Sun, 7 Mar 2004, JoeHill wrote:

> On Sun, 7 Mar 2004 10:15:25 -0500
> John Wildberger disseminated the following:
>
> > In one directory I have a number of files ( several hundred) with the file
> > extension .pgn.

    I am assuming that these are .pgn files and not .png files.

> > I would like to append all these files to a single file in another directory.
> > Does anyone know of an efficient way to do this.
>
> cat /path/to/*.pgn > /path/to/<outputfile>

    This will work if the files have a blank line at the beginning or
    the end. The PGN standard requires a blank line between games.

    If not, use:

for file in *.pgn
do
   cat "$file"
   printf "\n"
done | tr -s '\n' > NEWFILE

    If you are interested, I have some scripts that do various things
    to PGN files.

-- 
	Chris F.A. Johnson                      http://cfaj.freeshell.org
	=================================================================
                Everything in moderation -- including moderation
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list