Community discussions

MikroTik App
 
rviteri
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 85
Joined: Fri Nov 18, 2011 5:53 pm

Putting contents of a file into a variable

Sat May 05, 2012 10:46 am

Hello all I need to put the contents of a file which is over 4096 bytes into a variable. How can I do this?
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: Putting contents of a file into a variable

Sat May 05, 2012 10:30 pm

what is the contents?? ip adress??
 
rviteri
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 85
Joined: Fri Nov 18, 2011 5:53 pm

Re: Putting contents of a file into a variable

Sun May 06, 2012 3:40 am

Yes, I have a set of Ip addresses that I want to load into the router as address lists but its over 4096 bytes.
 
rviteri
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 85
Joined: Fri Nov 18, 2011 5:53 pm

Re: Putting contents of a file into a variable

Sun May 06, 2012 3:37 pm

I was able to accomplish the task using the perl API and sending my IP this way.
 
ditonet
Forum Veteran
Forum Veteran
Posts: 835
Joined: Mon Oct 19, 2009 12:52 am
Location: Europe/Poland/Konstancin-Jeziorna
Contact:

Re: Putting contents of a file into a variable

Sun May 06, 2012 4:37 pm

My working solution:
Convert IP address list to script which adds IP addresses to 'Address List', then upload it via FTP.
If script file name ends with '.auto.rsc', eg. 'filename.auto.rsc' it will be executed automatically after upload,
if not simply execute 'import file-name=your_script.rsc' command.

HTH,

Who is online

Users browsing this forum: No registered users and 11 guests