changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/xls2txt

changeset 7243: 34f64dcbbc25
parent: efddda59690a
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
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