strsplit use <TAB> separator key
Eröffnet am: 2020-06-04 21:26
Letztes Update: 2020-06-06 12:44
Auswertung: | chenfou2001 | Verantwortlicher: | (Keine) |
---|---|---|---|
Priorität: | 3 | Meilenstein: | (Keine) |
Typ: | Support-Anfragen | Schweregrad: | 3 |
Komponente: | Tera Term | Status: | Offen |
Lösung | Keine |
Einzelheiten
When using strsplit function separator key is tab key
How to use LINE 2's groupmatchstr2 to get 1 and groupmatchstr3 to get 2
ex: host.txt 192.168.1.1<tab>1<tab>2 192.168.1.2<tab><tab>1<tab>2 TTL file: fileopen fhandle "C:\host.txt" 0 code2str tab_key $9 filereadln fhandle line strsplit line tab_key OUTPUT: LINE 1 groupmatchstr1=192.168.1.1 groupmatchstr2=1 groupmatchstr3=2 LINE 2 groupmatchstr1=192.168.1.2 groupmatchstr2=empty groupmatchstr3=1
Kommentar
"strsplit" macro command splits a string by "one delimiter character." https://ttssh2.osdn.jp/manual/4/en/macro/command/strsplit.html
If separated by <tab> character, 2nd part of line 2 is ""(empty string.) I think this behavior is not wrong.
To ignore empty column, check length of groupmatchstr2 variable, and skip it.