![]() ![]() ![]() The counter index has been implemented in order not to lose a single line of the original text file, which could happen without, because random may return duplicate values with index appended, the resulting variable names $$!random!.!index! are unique. Nevertheless I want to provide a solution with all the listed limitations eliminated (although cmd-related restrictions like file sizes, | and ". Rem replace the original with the temp version ![]() Rem read each line of the file, write any that don't match and then write the one that does Rem geta random number between 1 and the number of lines in the file Rem Relocate as many lines as there are lines in the file Rem the find prepends the line number so we catch blank linesįor /f "delims=" %%n in ('find /c /v "" %1') do set "len=%%n" Feed it a command line parameter of the file to randomize. That is all I want, but any suggestions are welcome. Take one random MAC address, remove it from maclist_temp.txt.Make a temp copy of maclist.txt called maclist_temp.txt. ![]() Randomization would be better though, but I want to keep the original list. Something as simple as extracting and deleting a random line and then adding to the bottom might work. I'm still actively looking, but any advice would be extremely useful. I have tried Google and searching the web, but I haven't found anything too useful. Then, it will pull this randomized file in order. How this will work is that it will read "maclist.txt", then create a new temp file with the random order "maclist_temp.txt", that will be the rearranged file. My thought on how to approach this is to randomize or rearrange the order of the MAC address in the text file with this script, but I cannot figure out how to do this with a batch file. (q, a, b, c, d, ans).I am creating a code that strips through different MAC addresses randomly, but cannot figure out how to do this. What I want to do is to be able to randomize through the text file, but still maintaining the same structure. And it displays the questions based on order. I have no trouble reading it that way: public class rar I am trying to read a text file in Java, basically a set of questions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |