mIRC Home    About    Download    Register    News    Help

Print Thread
help script #259299 01/11/16 10:28 PM
Joined: Nov 2016
Posts: 3
E
entersandman Offline OP
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Nov 2016
Posts: 3
Hello!
I am new to this and do not understand much
I have the following file...
html.txt
Quote:

atinsana
2 463 447 4 518 291
4

45
SeN-akista
1 439 396 1 539 278
5

40
castle.55
1 308 210 12 277 319
6

44
ciwantrhn47
942 107 11 365 262
7

32
PREY
885 683 693 379
8

51
Hz.Arif
819 200 12 471 336
9

31
Bergamot.
726 774 355 222
10

32
gozogur
724 167 4 134 284
11

32
KaaaN
628 409 2 094 257
12

47
altinerizmir1
619 390 3 372 500
13

46
oldrifle_tr
420 964 4 344 387
14

48
Blacknight13
332 604 490 273
15

28
m.keser
261 787 3 395 88


I want to achieve this ...
table.txt
Quote:
var dataSet = [
[ "atinsana", "2463447"],
[ "SeN-akista", "1439396"],
[ "castle.55", "1308210"],
[ "ciwantrhn47", "942107"],
[ "PREY", "885683"],

...
];


And I only managed to get nicknames...
Code:
alias l {
  var %i = 1
  var %len = $lines(folder/html.txt)
  while (%i <= %len) {
    if $count($read(folder/html.txt,%i),a) {  write folder/table.txt $read(folder/html.txt,%i) }
    inc %i 
  }
}

Re: help script [Re: entersandman] #259305 03/11/16 02:22 AM
Joined: May 2015
Posts: 249
splinny Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
You want to get only nick and 1+2+3 of 6 or 1+2 of 5 groups? Without first\forth line numbers?


Dont give a fish - teach to fish!
Re: help script [Re: splinny] #259308 04/11/16 12:03 AM
Joined: Nov 2016
Posts: 3
E
entersandman Offline OP
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Nov 2016
Posts: 3
Hello splinny! sorry for my English, I am using the translator
Code:
48
Blacknight13
332 604 490 273
15

Nickname and first 2 groups ( [ "Blacknight13", "332604"], )
The problem is the following...
Code:
45
SeN-akista
1 439 396 1 539 278
5

Nickname and first 3 groups, the score is 1 millon ( [ "SeN-akista", "1439396"], )

I'd settle for the above example

Re: help script [Re: entersandman] #259434 22/11/16 12:55 AM
Joined: Nov 2016
Posts: 3
E
entersandman Offline OP
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Nov 2016
Posts: 3
Good evening, friends, I have been able to advance in the code and clean enough the leftover numbers and I stay something like this ...

Code:
alias htmlremove { return $regsubex($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,) }

alias cleartxt {
  var %i = 1
  var %len = $lines(html.txt)
  while (%i <= %len) {
    if $htmlremove($read(html.txt,%i)) { echo -a $remove($v1,&nbsp;) }
    inc %i
  }
}


The result is...

Code:
atinsana
2463447
SeN-akista
1439396
castle.55
1308210
ciwantrhn47
942107PREY
885683
Hz.Arif
819200
Bergamot.
726774


I want to save it in a txt as follows...

Code:
atinsana|2463447
SeN-akista|1439396
castle.55|1308210
ciwantrhn47|942107
PREY|885683
Hz.Arif|819200
Bergamot.|726774


Any ideas?