Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
rfork en
4
 
5
if(! ~ $#* 0 1) {
6
	echo 'usage: xls2txt [file.xls]' >[1=2]
7
	exit usage
8
}
9
 
10
switch($#*){
11
case 0
12
	cat >/tmp/xls2txt.$pid
13
	file=/tmp/xls2txt.$pid
14
case 1
15
	file=$1
16
}
17
aux/olefs $file || { 
18
	echo 'xls2txt: couldn''t mount excel document' >[1=2]
19
	rm -f /tmp/xls2txt.$pid
20
	exit word
21
}
22
 
23
if(! test -f /mnt/doc/Workbook) {
24
	echo 'xls2txt: is an MSoffice doc but not an Excel document' >[1=2]
25
	rm -f /tmp/xls2txt.$pid
26
	exit wordxls
27
}
28
 
29
aux/msexceltables /mnt/doc/Workbook
30
unmount /mnt/doc
31
rm -f /tmp/xls2txt.$pid
32