Remove width specifications from range strings (eg %3d-%3d)
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 3 Oct 2020 05:37:26 +0000 (07:37 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 27 Sep 2020 19:15:55 +0000 (21:15 +0200)
src/language/data-io/data-parser.c: Change %3d to %d
src/language/data-io/print.c: ditto

Having these width specifications resulted in an ugly space after
the dash.  Removing them means the the output is more aesthetically
pleasing in my opinion.

13 files changed:
src/language/data-io/data-parser.c
src/language/data-io/print.c
tests/language/data-io/data-reader.at
tests/language/data-io/dataset.at
tests/language/data-io/list.at
tests/language/dictionary/weight.at
tests/language/expressions/evaluate.at
tests/language/stats/autorecode.at
tests/language/stats/crosstabs.at
tests/language/stats/descriptives.at
tests/language/utilities/title.at
tests/language/xforms/compute.at
tests/language/xforms/count.at

index e14cba7dc20f7898a8ee070a5706d553d6c88683..2f24b8a23886877be6dbde22f680b209b9d4108f 100644 (file)
@@ -695,7 +695,7 @@ dump_fixed_table (const struct data_parser *parser,
 
       int first_column = f->first_column;
       int last_column = f->first_column + f->format.w - 1;
-      char *columns = xasprintf ("%3d-%3d", first_column, last_column);
+      char *columns = xasprintf ("%d-%d", first_column, last_column);
       pivot_table_put2 (table, 1, variable_idx,
                         pivot_value_new_user_text (columns, -1));
       free (columns);
index 5ee7fdd36998b12a0f46e7411255691da0d3117c..3b34dfcd8767ab09214d8edf9f9ed36f738d1639 100644 (file)
@@ -450,7 +450,7 @@ dump_table (struct print_trns *trns)
                         pivot_value_new_integer (spec->record));
       int last_column = spec->first_column + spec->format.w - 1;
       pivot_table_put2 (table, 1, row, pivot_value_new_user_text_nocopy (
-                          xasprintf ("%3d-%3d",
+                          xasprintf ("%d-%d",
                                      spec->first_column, last_column)));
 
       char fmt_string[FMT_STRING_LEN_MAX + 1];
index 85a5e87851ddfcb54b1d90567bb7a95858aa0576..4156abf86908f2940e33d7dccf64891bcae2c4d7 100644 (file)
@@ -35,8 +35,8 @@ END DATA.
 AT_CHECK([pspp -O format=csv begin-data.sps], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-a,1,1-  1,F1.0
-b,1,2-  2,F1.0
+a,1,1-1,F1.0
+b,1,2-2,F1.0
 
 Table: Data List
 a,b
@@ -64,8 +64,8 @@ list.
 AT_CHECK([pspp -O format=csv begin-data.sps], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-A,1,1-  1,F1.0
-B,1,2-  2,F1.0
+A,1,1-1,F1.0
+B,1,2-2,F1.0
 
 Table: Data List
 A,B
index 885520ed09b68021cff5a5410eb6178bf432044c..ea3bcc6f095d98c1c0c442a52fe8b9f4866db90c 100644 (file)
@@ -319,11 +319,11 @@ LIST.
 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-x,1,1-  1,F1.0
+x,1,1-1,F1.0
 
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-y,1,2-  4,F3.0
+y,1,2-4,F3.0
 ])
 
 AT_CLEANUP
\ No newline at end of file
index 35acbbec771ef4b1dece9029d34ca25990d3e106..0eb7c8c9c58380edf55ca2c853e77fd0efd326f5 100644 (file)
@@ -39,8 +39,8 @@ AT_CHECK([pspp -o pspp.csv list.sps])
 AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Reading 1 record from `data.txt'.
 Variable,Record,Columns,Format
-avar,1,1-  5,F5.0
-bvar,1,6- 10,F5.0
+avar,1,1-5,F5.0
+bvar,1,6-10,F5.0
 
 Table: Data List
 avar,bvar
@@ -82,8 +82,8 @@ AT_CHECK([pspp -o pspp.csv list.sps])
 AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Reading 1 record from `data.txt'.
 Variable,Record,Columns,Format
-avar,1,1-  5,F5.0
-bvar,1,6- 10,F5.0
+avar,1,1-5,F5.0
+bvar,1,6-10,F5.0
 
 Table: Data List
 Case Number,avar,bvar
index a4a927b9a248b70a6a7e9b6f3d4bbc7a40b638c0..36da46f4e3f90dddffb4454971cf33482efb74dd 100644 (file)
@@ -83,8 +83,8 @@ AT_CHECK([pspp -o pspp.csv -o pspp.txt weight.sps])
 AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Reading 1 record from `weight.txt'.
 Variable,Record,Columns,Format
-AVAR,1,1-  5,F5.0
-BVAR,1,6- 10,F5.0
+AVAR,1,1-5,F5.0
+BVAR,1,6-10,F5.0
 
 Table: Descriptive Statistics
 ,N,Mean,S.E. Mean,Std Dev,Variance,Kurtosis,S.E. Kurt,Skewness,S.E. Skew,Range,Minimum,Maximum,Sum
index cec32e76214d6c6bc260e19b2423346b189bb375..52123c75adbab510844ceeb38a8ecfce885ff015 100644 (file)
@@ -2006,7 +2006,7 @@ AT_CHECK([pspp -o pspp.csv lag.sps])
 AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-W,1,1-  1,F1.0
+W,1,1-1,F1.0
 
 Table: Data List
 W,X,Y,Z
index 7e886fa08cdb06e8ecddee8b3bde2ef37e924b68..371746117f76a44482ab2dd359cea80b70d8efc7 100644 (file)
@@ -142,8 +142,8 @@ list.
 AT_CHECK([pspp -O format=csv autorecode.sps], [0],
   [Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-X,1,1-  5,A5
-Y,1,7-  7,F1.0
+X,1,1-5,A5
+Y,1,7-7,F1.0
 
 Table: Recoding X into A.
 Old Value,New Value,Value Label
@@ -454,8 +454,8 @@ list.
 AT_CHECK([pspp -O format=csv autorecode.sps], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-X,1,1-  5,A5
-Y,1,7-  7,F1.0
+X,1,1-5,A5
+Y,1,7-7,F1.0
 
 Table: Recoding X into A.
 Old Value,New Value,Value Label
index 21154183fceb1c055ad0f0cc7400c0895057efbd..40117dc7e91f3d9d88236aaeac1162dac6b53398 100644 (file)
@@ -153,9 +153,9 @@ CROSSTABS TABLES  y by z.
 AT_CHECK([pspp -o - -O format=csv -o pspp.txt crosstabs.sps], [0],
   [Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-x,1,1-  2,F2.0
-y,1,3-  3,F1.0
-z,1,4-  4,F1.0
+x,1,1-2,F2.0
+y,1,3-3,F1.0
+z,1,4-4,F1.0
 
 Table: Data List
 x,y,z
@@ -355,9 +355,9 @@ CROSSTABS TABLES  x BY y BY z/STATISTICS=ALL.
 AT_CHECK([pspp -o - -O format=csv -o pspp.csv -o pspp.txt crosstabs.sps], [0],
   [Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-x,1,1-  2,F2.0
-y,1,3-  3,F1.0
-z,1,4-  4,F1.0
+x,1,1-2,F2.0
+y,1,3-3,F1.0
+z,1,4-4,F1.0
 
 Table: Data List
 x,y,z
index b737890253d86c99570885af8f72221535c9208b..7b4d29662cf8c05bc602c8616fb99cb86c5c3763 100644 (file)
@@ -39,23 +39,23 @@ descript all/stat=all/format=serial.
 AT_CHECK([pspp -O format=csv descriptives.sps], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-V0,1,1-  1,F1.0
-V1,1,2-  2,F1.0
-V2,1,3-  3,F1.0
-V3,1,4-  4,F1.0
-V4,1,5-  5,F1.0
-V5,1,6-  6,F1.0
-V6,1,7-  7,F1.0
-V7,1,8-  8,F1.0
-V8,1,9-  9,F1.0
-V9,1,10- 10,F1.0
-V10,1,11- 11,F1.0
-V11,1,12- 12,F1.0
-V12,1,13- 13,F1.0
-V13,1,14- 14,F1.0
-V14,1,15- 15,F1.0
-V15,1,16- 16,F1.0
-V16,1,17- 17,F1.0
+V0,1,1-1,F1.0
+V1,1,2-2,F1.0
+V2,1,3-3,F1.0
+V3,1,4-4,F1.0
+V4,1,5-5,F1.0
+V5,1,6-6,F1.0
+V6,1,7-7,F1.0
+V7,1,8-8,F1.0
+V8,1,9-9,F1.0
+V9,1,10-10,F1.0
+V10,1,11-11,F1.0
+V11,1,12-12,F1.0
+V12,1,13-13,F1.0
+V13,1,14-14,F1.0
+V14,1,15-15,F1.0
+V15,1,16-16,F1.0
+V16,1,17-17,F1.0
 
 Table: Descriptive Statistics
 ,N,Mean,S.E. Mean,Std Dev,Variance,Kurtosis,S.E. Kurt,Skewness,S.E. Skew,Range,Minimum,Maximum,Sum
index bcc0320a2d480f78a11b05c76b3fbf39227ca6a6..822b5c509198c0ebaf8fa1fb14f14ebf0ce51e5a 100644 (file)
@@ -77,8 +77,8 @@ dnl Filter out the dates/times
 AT_CHECK([[sed 's/(Entered [^)]*)/(Entered <date>)/' pspp.csv]], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-X,1,1-  1,F1.0
-Y,1,2-  2,F1.0
+X,1,1-1,F1.0
+Y,1,2-2,F1.0
 
 Table: Documents
 "document First line of a document
index 981561aad5c52a579f8710cf9ac84953f8ae5551..65ca4af121276d2216a50c78eda7120fd18d2009 100644 (file)
@@ -105,7 +105,7 @@ END DATA.
 AT_CHECK([pspp -O format=csv compute.sps], [0],
   [Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-ITEM,1,1-  3,F3.0
+ITEM,1,1-3,F3.0
 ])
 AT_CHECK([cat compute-sum.out], [0],
   [ 123   123.00 @&t@
index 0812bc06992d60f9e3205286932dd03ddd04ea23..4a67b0273b763d1667ec261318390e3f633c7be1 100644 (file)
@@ -75,8 +75,8 @@ LIST.
 AT_CHECK([pspp -O format=csv count.sps], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-v1,1,1-  2,A2
-v2,1,3-  4,A2
+v1,1,1-2,A2
+v2,1,3-4,A2
 
 Table: Data List
 v1,v2,c