Vertical StringSplit Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Vertical StringSplit

Post by Fulminare » 24 Sep 2021, 08:55

This works for words that are in the same row

Code: Select all

TestString := "This is a test."
word_array := StrSplit(TestString, A_Space, ".") ; Omits periods.
MsgBox % "The 4th word is " word_array[4]
Can anyone please tell me how to use StrigSplit for data thats in multiple rows ?

eg:

[Barry]
year=2021
month=09
runs=5


The output should be something like

"Barry" "Text" "run count" (which in this case is 5) { Barry Text 5 }

I will try to add the text by myself. I don't even know how to proceed in the first place.

Regards.

Rohwedder
Posts: 7608
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Vertical StringSplit  Topic is solved

Post by Rohwedder » 24 Sep 2021, 09:39

Hallo,
try:

Code: Select all

TestString =
(
[Barry]
year=2021
month=09
runs=5
)
Text := " Text "
word_array := StrSplit(TestString, ["`n","`r","="], "[]")
MsgBox % word_array[1] Text word_array[7]

Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Re: Vertical StringSplit

Post by Fulminare » 24 Sep 2021, 10:20

Oh yes :D
Thank you !

Post Reply

Return to “Ask for Help (v1)”