Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to code in ksh to save result into different tab in exc

Status
Not open for further replies.

vuakhobo

Technical User
Apr 22, 2004
41
US
Is there a way to code in ksh to save result into different tab in excel ?

For example: result 1st run save into sheet1
result 2nd run save into sheet2
result 3rd run save into sheet3

Right now I can only save into one Excel and use cut and paste later in excel to move them into indvidual blank tab sheet1, sheet2 and sheet3

Currently code:

#---------------------
#Get REQ Record count
#---------------------
echo $1 >> $CSV_FILE
for infile in `ls -1 $IN_DIR/$SEARCH`; do
incount=`wc -l < $infile|sed 's/^ *//'`
file=`basename $infile`
echo $file, $incount >> $CSV_FILE
done
 
The CSV file format has no notion of multiple tabs or sheets...

You might want to try and put the different data under different "virtual" sheet names you put in column 1 with the data from column 2 onwards.

Then open the CSV file and run a macro of some sorts in excel to distribute the data rows starting at column 2 into different sheets with the names out of column 1, but it 'll be some mean macro coding in excel I'd expect.

HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top