Number formatting problem with Channel Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
E.g.
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.
Any ideas?
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
Solved! Go to Solution.
- Labels:
-
Library (GDL)
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2022-10-31 11:20 PM
Thanks runxel. I guess I'll have to learn XML 🙂
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.