Text encoding?

I’m trying to load the IP list from this site with a script I use to load many other lists.

https://feodotracker.abuse.ch/downloads/ipblocklist_recommended.txt

The script gets to the point where its adding the IP to the list but it fails.
I reproduced the issue on the command line.
There is a global variable called $Fline that has the first IP
[ssp@Tik] > :put $Fline
1.234.21.73

This works
[ssp@Tik] > /ip firewall address-list add address=1.234.21.73 list=FeodoC2

This fails
[ssp@Tik] > /ip firewall address-list add address=$Fline list=FeodoC2
is not a valid dns name

I have another variable that came from a different list and this one works fine
[ssp@Tik] > :put $Tline
185.242.113.224
[ssp@Tik] > /ip firewall address-list add address=$Tline list=FeodoC2
[ssp@Tik] >

only think I can figure is the source has some strange encoding but not sure how to see that in Mikrotik
any ideas what could cause this?

Show the script.


https://feodotracker.abuse.ch/downloads/ipblocklist_recommended.txt

Two ideas:

  1. You aren’t handling the comment lines, beginning with “#” characters.
  2. Your script assumes Unix line endings (“\n”), whereas this file uses DOS line endings (“\r\n”).

The problem is not the coding of the text, the problem is that you do not read or understand the reply.

I have already replied to you:

and the problem still the same.

[test@matrix] >:put ">$Fline<"

1.234.21.73
<
[test@matrix] >:put ">$Tline<"
185.242.113.224<
[test@matrix] >
[test@matrix] > /system script add name=test source=$Fline
[test@matrix] > /system script export

jun/17/2022 11:40:21 by RouterOS 6.6.6

software id = I4C6-66VX

model = SXT 5SVHPaxT

serial number = 45EFX2EAC666

/system script
add name=test owner=rex source="1.234.21.73**\r**"
[test@matrix] >
Mmm... I just invent a method to convert a string to "RouterOS Escaped code and vice-versa..."

ok. I did open the file in Notepad++ with end of line char turned on. I see it. was not sure if Notepad++ inserted that since I’m on a Windows machine but guess not.
I’ll give that a try.
Thank you!!

the script handles the “#” characters.
I think you are right about eol characters will try that.