0

I think this question was already asked but I can't find it so I'm going to ask it. I want to be able to open a .txt file and make each line in to a variable.

Misha Eide
  • 47
  • 1
  • 5
  • What precisely do you mean by *"make each line in to a variable"*? What do you want to happen? What have you tried? And what happened instead? – jonrsharpe May 05 '17 at 22:32
  • Okay. So what I mean is I want to open a txt file. Take the first line and save it as the variable named 'username'. I then want it to loop something then go to the next line and make the variable 'username' the next line. – Misha Eide May 05 '17 at 22:33
  • Instead of overwriting your variable each time it would be better to use @KeeganKuhn 's linked solution and work with a list of usernames. – Vinícius Figueiredo May 05 '17 at 22:35
  • Okay. I think I found what I wanted here. http://stackoverflow.com/questions/3277503/how-do-i-read-a-file-line-by-line-into-a-list – Misha Eide May 05 '17 at 22:36
  • You just need to do your for loop for each username in the list after that procedure. – Vinícius Figueiredo May 05 '17 at 22:39

0 Answers0