Python Forum
reading all lines from a text file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
reading all lines from a text file
#1
I am trying to create a function that reads each line from a .txt file. After reading all lines it should write the md5 hash value of each line/word to a new output .txt file.

I know to read all lines is myfile = open("file.txt", "r") myfilewrite = open("file2.txt", "w")

I am having a hard time incorporating the 2. Thanks
Reply
#2
Show us the code. What have you tried so far? What makes it difficult?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
Show the total code what you wrote .
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Excel File reading vanjoe198 1 2,026 Mar-31-2021, 11:53 AM
Last Post: snippsat
  Reading a text until matched string and print it as a single line cananb 1 2,017 Nov-29-2020, 01:38 PM
Last Post: DPaul
  reading from a file looseCannon101 14 4,835 Jul-18-2020, 11:29 AM
Last Post: GOTO10
  Reading 2 lines Dyefull 1 1,688 Nov-21-2019, 01:48 AM
Last Post: ichabod801
  Convert text from an image to a text file Evil_Patrick 5 4,265 Jul-30-2019, 07:57 PM
Last Post: DeaD_EyE
  Weird problem with reading from file and performing calculations pineapple999 1 2,991 Jul-25-2019, 01:30 AM
Last Post: ichabod801
  Handling IO Error / Reading from file Expel 10 4,803 Jul-18-2019, 01:21 PM
Last Post: snippsat
  Reading an Unconventional CSV file OzSbk 2 3,863 May-17-2019, 12:15 PM
Last Post: MvGulik
  reading text file and writing to an output file precedded by line numbers kannan 7 10,366 Dec-11-2018, 02:19 PM
Last Post: ichabod801
  Reading of structured .mat (matlab) file sumit 2 3,403 May-24-2018, 12:12 PM
Last Post: sumit

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020