@@ -76,8 +76,6 @@ Putting it all together in a shell script.
7676 // Application Options
7777 showSheetCount bool
7878 showSheetNames bool
79- verbose bool
80- permissive bool
8179)
8280
8381func sheetCount (workBookName string ) (int , error ) {
@@ -108,23 +106,12 @@ func xlsx2CSV(out io.Writer, workBookName, sheetName string) error {
108106 results := [][]string {}
109107 cells := []string {}
110108 if sheet , ok := xlFile .Sheet [sheetName ]; ok == true {
111- for i , row := range sheet .Rows {
109+ for _ , row := range sheet .Rows {
112110 //FIXME: I would be nice to optionally only the columns you wanted to output from the sheet...
113111 cells = []string {}
114- for j , cell := range row .Cells {
115- val , err := cell .String ()
116- if err != nil {
117- if permissive == true {
118- cells = append (cells , fmt .Sprintf ("%s" , val ))
119- } else {
120- cells = append (cells , fmt .Sprintf ("%s" , err ))
121- }
122- if verbose == true {
123- fmt .Fprintf (os .Stderr , "row %d, col %d %s\n " , i , j , err )
124- }
125- } else {
126- cells = append (cells , val )
127- }
112+ for _ , cell := range row .Cells {
113+ val := cell .String ()
114+ cells = append (cells , val )
128115 }
129116 results = append (results , cells )
130117 }
@@ -156,8 +143,6 @@ func init() {
156143 // App Specific Options
157144 flag .BoolVar (& showSheetCount , "c" , false , "display number of sheets in Excel Workbook" )
158145 flag .BoolVar (& showSheetNames , "n" , false , "display sheet names in Excel W9rkbook" )
159- flag .BoolVar (& verbose , "verbose" , false , "output cell level errors" )
160- flag .BoolVar (& verbose , "permissive" , false , "ignore cell level errors" )
161146}
162147
163148func main () {
0 commit comments