[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] help with a tiny shell script
- Subject: [ale] help with a tiny shell script
- From: esoteric at 3times25.net (Geoffrey)
- Date: Tue Nov 16 08:08:34 2004
- In-reply-to: <[email protected]>
- References: <[email protected]>
jay wrote:
> Here's the scoop...I have about 330 csv files that are results files from a
> survey. I want to import them into a spreadsheet for graphing, but when
> coding the survey in php, my partner and I didnt place a line break after
> each results file finishes.
>
> The result is 330 files like this:
>
> 2,0,0,1,1,3,1,10,2,0,2,1,1,0, * "short answer"
>
> Each file is one line, with a set of comma deliminated numerical answers, then
> one short answer question, separated by the star as you see above. What I
> want to do is basically:
>
> cat *.csv > append.csv
for fn in *.csv; do
cat $fn
echo
done > output
OR
for fn in *.csv; do
sed 's/$/\n/' $fn
done > output
--
Until later, Geoffrey