Jump to content
UBot Underground

Blank Lines Problem


Recommended Posts

hi,

 

set(#scrape,"1

3
4
5

6

8

9
","Global")
add list to list(%list,$list from text(#scrape,$new line),"Don\'t Delete","Global")

 

 

my problem auto delete blank lines.

 

necessary - blank lines

 

#scrape 12 line

%list 7 line

 

auto delete blank lines

 

how to make add blank lines?

 

Link to post
Share on other sites

Hi,

set(#scrape,"1

3
4
5

6

8

9
","Global")
alert($replace regular expression(#scrape,"\\s+",$new line))
add list to list(%data,$list from text($replace regular expression(#scrape,"\\s+",$new line),$new line),"Delete","Global")
alert(%data)

Regards,
Nick

Link to post
Share on other sites

Hi,

set(#scrape,"1

3
4
5

6

8

9
","Global")
alert($replace regular expression(#scrape,"\\s+",$new line))
add list to list(%data,$list from text($replace regular expression(#scrape,"\\s+",$new line),$new line),"Delete","Global")
alert(%data)

Regards,

Nick

 

don't working nick :(

Link to post
Share on other sites

This is a start at least, it won't get the last line still. But it will replace the others with _EMPTY_ so that you know it's supposed to be empty. I'm not 100% sure but I bet if you could convert that into a byte array it would be a lot easier because you could then read the carriage return and new line bytes - which I think is what is causing this problem.

Maybe there's a Py way to do it @CD

set(#scrape,"1

3
4
5

6

8

9
","Global")
clear list(%list)
add list to list(%list,$list from text($replace($replace regular expression(#scrape,"[^\\d]+\\n","_EMPTY_"),"_EMPTY_","{$new line}_EMPTY_{$new line}"),$new line),"Don\'t Delete","Global")
  • Like 1
Link to post
Share on other sites

lol, I thought SaHin wanted to remove the blank lines.

 

So, you can use the large data plugin like Varo mentioned above.

 

I am using UBot version 5.9.37 btw and don't delete is not working for me either. Is it reported?

 

Maybe it is fixed at hire versions.

 

Sure there is a python way but really depends on what SaHin is going to do with it. If SaHin wants to iterrate over it then we are kinda stuck. can use a $table!! add list to table as a column then loop total rows.

 

or

Use a place holder like @@ for the $new lines then iIF next list item contains @@ replace with $new line.

 

Regards,

Nick

Link to post
Share on other sites

omg, this did not work either

set(#scrape,"1

3
4
5

6

8

9
","Global")
clear table(&data)
add list to table as column(&data,0,0,$list from text(#scrape,$new line))
alert(&data)

What are you going to do with this data?

Link to post
Share on other sites

Now I am baffled why this won't work. I just get one in the alert.

set(#scrape,"1

3
4
5

6

8

9
","Global")
save to file("{$special folder("Desktop")}\\data.csv",#scrape)
clear table(&data)
create table from file("{$special folder("Desktop")}\\data.txt",&data)
alert(&data)

IDK

Link to post
Share on other sites

Try this:

set(#scrape,"1

3
4
5

6

8

9
","Global")
clear list(%replaceNewLines)
add list to list(%replaceNewLines,$list from text($replace regular expression($replace regular expression(#scrape,"\\n",",_EMPTY_"),"_EMPTY_(?=\\d+)",$nothing),","),"Don\'t Delete","Global")

Now your empty lines will say _EMPTY_ and you can choose to do whatever you need with those by looking for that tag.

  • Like 1
Link to post
Share on other sites

Try this:

set(#scrape,"1

3
4
5

6

8

9
","Global")
clear list(%replaceNewLines)
add list to list(%replaceNewLines,$list from text($replace regular expression($replace regular expression(#scrape,"\\n",",_EMPTY_"),"_EMPTY_(?=\\d+)",$nothing),","),"Don\'t Delete","Global")

Now your empty lines will say _EMPTY_ and you can choose to do whatever you need with those by looking for that tag.

 

 

Very Good, nice Working  :)

Link to post
Share on other sites

Try this:

set(#scrape,"1

3
4
5

6

8

9
","Global")
clear list(%replaceNewLines)
add list to list(%replaceNewLines,$list from text($replace regular expression($replace regular expression(#scrape,"\\n",",_EMPTY_"),"_EMPTY_(?=\\d+)",$nothing),","),"Don\'t Delete","Global")

Now your empty lines will say _EMPTY_ and you can choose to do whatever you need with those by looking for that tag.

 

 

 

new problem dear,

 

13 lines = code 12 lines

 

set(#scrape,"

1

 

3

4

5

 

6

 

8

 

9

","Global")

 

Link to post
Share on other sites

Okay I see now this will account for either or both leading and trailing new lines like that:

add list to list(%replaceNewLines,$list from text($replace regular expression($replace regular expression($replace regular expression(#scrape,"\\n","_EMPTY_,"),"(?<=\\d+)_EMPTY_",$nothing),",$",",_EMPTY_"),","),"Don\'t Delete","Global")
  • Like 2
Link to post
Share on other sites

 

Okay I see now this will account for either or both leading and trailing new lines like that:

add list to list(%replaceNewLines,$list from text($replace regular expression($replace regular expression($replace regular expression(#scrape,"\\n","_EMPTY_,"),"(?<=\\d+)_EMPTY_",$nothing),",$",",_EMPTY_"),","),"Don\'t Delete","Global")

very good thank you :)

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...