2022-10-31 10:31 PM
I have a part that opens a .txt file as a channel (TEXT filter), and imports (amongst other things) a date in the dd.mm.yy format.
If the separators used are periods, then everything works fine.
If the separators used are either slashes or hyphens (e.g. dd/mm/yy, or dd-mm-yy) then Archicad will see this as a formula, and give me the result on INPUT before I can do anything with it.
10.11.22 = 10.11.22
10/11/22 = 0.0413
10-11-22 = -23
I can get around this by prefixing the date with a character (e.g. ~) to turn it into a string, then run a STRSUB to extract the date - but if I can get around this I would prefer that instead, as this is an extra step for the user in the *.txt file.
Solved! Go to Solution.
2022-10-31 11:14 PM
Bruce, I have bad news for you, I guess. It won't work. The text add-on does some weird auto-casting into types and you simply can not get around that, not even by initializing your variables (as you probably found out already).
The only solution is to either force the input to be recognized as text, or to switch to XML – everything is text there and thus predictable.
2022-10-31 11:20 PM
Thanks runxel. I guess I'll have to learn XML 🙂
2022-11-03 11:11 AM - edited 2022-11-03 11:15 AM
GDL txt addon uses only a dot/period as a separator no matter what is a local setting.
BTW: I did a little workaround on txt loading lately:
when walking through the external table (I use it for the tables mostly) I save 2 matrix parameters: First is a string and second is a number. Then to create an output I just merge them together with proper formatting the numbers (STR...). The only drawback is with empty cells.