:O) thankyou kindly Cameron -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ronald Landheer-Cieslak Sent: Wednesday, November 26, 2003 6:53 AM To: [EMAIL PROTECTED] Subject: Re: newby stupid question - cat mutiple files to new piped output files
On Wed, Nov 26, 2003 at 04:55:34AM -0500, c wrote: > Just started to get somewhere until i wanted to cat a heap of csv files and > then send the unique records to a new file. > I thought it couldnt be to hard but now my brain hurts. > Can anyone help me with a line of code that will do the command below > '$ cat d:/pc1/filename.csv |uniq > d:/pc1/newfilename.csv' > but i want it do it repeatidly for every .csv file in that directory? This has nothing to do with Cygwin, but hey.. for i in /cygdrive/d/pc1/*.csv; do cat $i | uniq > /cygdrive/d/pc1/newfilename.csv done This will work once, because the new files won't be there yet. After that, the *.csv will pick up the new files as well.. Take a look at the "Advanced Bash scripting guide" which you can find at http://tldp.org for info on how to do this kind of thing correctly.. HTH rlc -- Dave Mack: "Your stupidity, Allen, is simply not up to par." Allen Gwinn: "Yours is." -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.543 / Virus Database: 337 - Release Date: 11/21/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.543 / Virus Database: 337 - Release Date: 11/21/2003 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/