[ale] help with a tiny shell script - correction

Geoffrey esoteric at 3times25.net
Tue Nov 16 08:13:07 EST 2004


Jonathan Glass wrote:
> Quoting Christopher Bergeron <christopher at bergeron.com>:
> 
> 
>>Correction:  the for line should read:
>>for i in `\ls *.csv`; do cat $i >> append.csv; echo -e "\n" >> 
>>append.csv; done
>>(for i in backtick backslash ls start dot csv backtick semicolon ...)
>>
>>Also, it should be noted that this will concatenate the output of EVERY 
>>.csv file in that directory.  If you have .csv files you don't want 
>>appended to "append.csv" you need to make adjustments accordingly.
>>
>>Kind regards,
>>CB
> 
> 
> you should be able to do 
> $ for i in *.csv; do cat $i >> append.csv; echo -e "\n" >> append.csv; done

you can shorten the script and make it more efficient by opening the 
output file once:

for i in *.csv; do cat $i; echo -e "\n"; done > append.csv

-- 
Until later, Geoffrey



More information about the Ale mailing list