[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] script help please (OT)



On Mon, 2005-05-23 at 09:21, Jimmy Schwankl wrote:

> What he would like is for the first line to have the next three lines  
> appended to it with the first item stripped out so that when he  
> imports the file into a spreadsheet all the data for each record is  
> on one line.

Assuming that the first item is always numeric, this will read stdin
and write to stdout, so use <inputfile >outputfile for files.

#!/bin/sh
while read LINE1
do
 for num in 2 3 4
  do
  read IN
  eval LINE$num=`echo $IN |sed -es/^[0-9]*,//`
  done
 echo $LINE1,$LINE2,$LINE3,$LINE4
done

-- 
  Les Mikesell
   les futuresource com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]