01-08-2025 12:12 PM
I have a 1D array of integers. For example:
paul_a_cardinale_0-1736359565783.png
I can easily use this:
paul_a_cardinale_1-1736359683170.png to yield this:
paul_a_cardinale_2-1736359716205.png
But what I really want is for every other separator to be a slash, like this:
paul_a_cardinale_4-1736359885507.png
Who can come up with the simplest code to do that?
01-08-2025 12:17 PM
I'd actually rather see how Rube-ish we can get it. 😉
01-08-2025 12:32 PM
01-08-2025 02:08 PM
@raphschru wrote:
If using subVIs from vi.lib is allowed:
And if not (or even in general!), we would probably do this.
altenbach_0-1736366852785.png
(Of course we must be assume that there is an even number of elements)
01-08-2025 02:33 PM
01-08-2025 02:35 PM
01-08-2025 02:39 PM
@raphschru wrote:
Yeah but "Array To Spreadsheet String" annoyingly adds an End of Line at the end, so you would have to trim that.
Yes, a simple trim whitespace (as in the original code) will do that...
(Still faster than digging through vi.lib unless you know exactly where things are ...) 😄
01-08-2025 02:53 PM - edited 01-08-2025 02:54 PM
@altenbach wrote:
@raphschru wrote:
Yeah but "Array To Spreadsheet String" annoyingly adds an End of Line at the end, so you would have to trim that.
Yes, a simple trim whitespace (as in the original code) will do that...
(Still faster than digging through vi.lib unless you know exactly where things are ...) 😄
Toolkit "Hidden Gems in vi.lib" adds a palette to expose some functions like this one.
I am sure Paul has it, since it adds some hidden scripting functions as well 🙂.
01-08-2025 02:55 PM
@billko wrote:
I'd actually rather see how Rube-ish we can get it. 😉
challenge accepted....
Rubeformatting.png
01-08-2025 04:45 PM
@billko wrote:
I'd actually rather see how Rube-ish we can get it. 😉
Another try:
BertMcMahan_0-1736376330417.png