Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #open file as read
  2. #create a variable to hold a line
  3. #empty list
  4. #create variables for first index and last index
  5. #0-40 characters
  6.  
  7. #create a current line variable that reads each line from 0:40
  8.  
  9. #create a loop that loops until the current line variable is equal to 0
  10.  
  11. #3 variables for first name, last name, and birthday at their given indexes
  12. #[0:16], [16:32], [32:40]
  13.  
  14. #conditional statements to check to see if a stripped first name and a stripped last name == F and L respectively
  15. #set birthday = B
  16.  
  17. #create a result variable that concatenates first name, last name, and birthday
  18. #append the variable to our list
  19.  
  20. #update first and last index variables
  21.  
  22. #update the current line variable with the new indexes
  23.  
  24. #close the file
  25.  
  26. #open file to write to
  27. #loop through the list we created with the birthdays
  28.  
  29. #write each element to our file
  30.  
  31. #close the file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement