Jump to content
UBot Underground

Adding Blank Line every 8 lines.. help?


Recommended Posts

1) Load text file myitems.txt

 

2) Myitems.txt has these items

 

gibberish5237015

dsfasar325725153

gjaeryuae5672552

ajyer9a764792t53

2384702347870234

3580273508273507

0esar7670ae6t902

723649sdfshfrlgh

23y9326793252352

3287502873580263

2837502635073252

 

3) I need them seperated into 8 lines at a time extras just on the buttom

 

gibberish5237015

dsfasar325725153

gjaeryuae5672552

ajyer9a764792t53

2384702347870234

3580273508273507

0esar7670ae6t902

723649sdfshfrlgh

 

23y9326793252352

3287502873580263

2837502635073252

 

 

4) save back to myitems2.txt

 

 

How would i accomplish this? :)

 

please help thanks!

Link to post
Share on other sites

This should work :)

Just copy these codes on code view.

 

clear list(%list)
clear list(%list2)
add list to list(%list, $list from text("gibberish5237015
dsfasar325725153
gjaeryuae5672552
ajyer9a764792t53
2384702347870234
3580273508273507
0esar7670ae6t902
723649sdfshfrlghea
23y9326793252352dsad
3287502873580263d
2837502635073252
gibberish5237015d3
dsfasar325725153423
gjaeryuae56725527
ajyer9a764792t5377
23847023478702347
35802735082735077
0esar7670ae6t90275
723649sdfshfrlgh657
23y932679325235275
3287502873580263765
28375026350732527
gibberish5237015765
dsfasar32572515357
gjaeryuae56725527765
2384702347870234765
3580273508273507756
0esar7670ae6t9029
723649sdfshfrlgh79
23y932679325235256
3287502873580263564
28375026350732529", "
"), "Delete", "Global")
set(#position, 1, "Global")
loop($list total(%list)) {
   if($comparison(#position, "=", 9)) {
       then {
           set(#position, 1, "Global")
           add item to list(%list2, $nothing, "Don\'t Delete", "Global")
       }
       else {
           add item to list(%list2, $next list item(%list), "Delete", "Global")
       }
   }
   increment(#position)
}
navigate("http://pastebin.com/", "Wait")
change attribute(<name="paste_code">, "value", $text from list(%list2, "
"))

Link to post
Share on other sites

Why not loop through, have a counter and do a modulus with 8 on the counter!? When there is no remains from the division, you know that it is completely possible to divide by 8 (every eigth row), then put in the extra row and continue.

 

This way the list can be as long as the numeric representation of the counter, so if it is a 32 bit counter it can be 2.1 billion items long.

 

There will be about the same amount of code as for Kreatus' solution.

Link to post
Share on other sites

Another take on same thing..

 

clear list(%list)
clear list(%list2)
add list to list(%list, $list from text("gibberish5237015
dsfasar325725153
gjaeryuae5672552
ajyer9a764792t53
2384702347870234
3580273508273507
0esar7670ae6t902
723649sdfshfrlghea
23y9326793252352dsad
3287502873580263d
2837502635073252
gibberish5237015d3
dsfasar325725153423
gjaeryuae56725527
ajyer9a764792t5377
23847023478702347
35802735082735077
0esar7670ae6t90275
723649sdfshfrlgh657
23y932679325235275
3287502873580263765
28375026350732527
gibberish5237015765
dsfasar32572515357
gjaeryuae56725527765
2384702347870234765
3580273508273507756
0esar7670ae6t9029
723649sdfshfrlgh79
23y932679325235256
3287502873580263564
28375026350732529", "
"), "Delete", "Global")
set(#list position, 0, "Global")
set(#position, 1, "Global")
loop($list total(%list)) {
   if($comparison(#position, ">=", 8)) {
       then {
           set(#position, 1, "Global")
           add item to list(%list2, $nothing, "Don\'t Delete", "Global")
       }
       else {
           add item to list(%list2, $list item(%list, #list position), "Don\'t Delete", "Global")
           increment(#list position)
       }
   }
   increment(#position)
}
clear list(%list)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...