You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user wanted to read spreadsheet change.xlsx using these statements:
set Family;
set Unit;
param Change {Family, Family, Unit};
table Family IN "amplxl" "change.xlsx": [Family] IN;
read table Family;
table Unit IN "amplxl" "change.xlsx": [Unit] IN;
read table Unit;
table Change IN "amplxl" "change.xlsx": [Fam1, Fam2, Unit], Change;
read table Change;
But read table Change; gave this error:
Error reading table Change with table handler amplxl:
Could not find column Change in spreadsheet table header
The error occurs because the column heading Change has a trailing space. There are several ways we could consider dealing with this hard-to-spot error:
Remove trailing spaces from headers.
Include the trailing space in the error message (so that there would be two spaces after column Change in the above example).
Modify the error message so that the trailing space is more obvious, for example by putting quotes around the column name (so that it would be column "Change " in the above example).
There's a similar issue with trailing spaces in non-numeric data. Typically they do not prevent the spreadsheet data from being read, but lead to an error like invalid subscript Change[1,1,'A '] discarded at some later point.
The text was updated successfully, but these errors were encountered:
4er4er4er
changed the title
Trailing spaces are significant
Trailing spaces cause hard-to-spot errors
Jan 5, 2021
A user wanted to read spreadsheet change.xlsx using these statements:
But
read table Change;
gave this error:The error occurs because the column heading
Change
has a trailing space. There are several ways we could consider dealing with this hard-to-spot error:column Change
in the above example).column "Change "
in the above example).There's a similar issue with trailing spaces in non-numeric data. Typically they do not prevent the spreadsheet data from being read, but lead to an error like
invalid subscript Change[1,1,'A '] discarded
at some later point.The text was updated successfully, but these errors were encountered: