Print output for hotspot users

Hello everyone,

I have tried to searched for a certain script that can export hotspot users along with their passwords to a CSV file but could not find one, now what I am left with is to output the usernames and passwords through print command at the terminal so that i can copy and paste in excel sheet

How can this be done? as the command /ip hotspot user print only prints other columns excluding the password


Thanks in advance

/ip hotspot user print detail file=filename.txt

or

/ip hotspot user export file=filename.txt

Then you should be able to import the txt file into a spreadsheet or in the case of the export simply modify the script directly.

thanks for your solution, i have already tried this but unfortunately it prints all columns in a format which is very difficult to sort out, I want to get only username and password of users

You can use “print as-value” to save the output into a variable, that you can then loop over, and output in whatever fashion you want.

f.e.

:local users [/ip hotspot user print as-value];
:foreach user in=users do={
    :put ($user->"username");
    :put ($user->"password");
    :put "";
};[code]

how to find this file in pc after exporting

export saves file to the router not pc. to access it on pc you have to download it.