Python Forum
Help me with python read file and save file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help me with python read file and save file
#1
ID, email, random letter, Password, random letter, Title, random letter, Email Account Register with.

Line 7 has a value "null" so if the null value is found skip the line and continue.

----------------------------------------------------------------------------------------
Filename input.txt

"ID":"Email","random letter":"Password","random letter":"Title","random letter":"Email Account Register with"

"1":"[email protected]","p":"password1","r":"PYTHON DEMO OUTPUT","d":"yahoo.com"
"2":"[email protected]","p":"password2","r":"PYTHON DEMO OUTPUT","d":"mail.bg"
"3":"[email protected]","p":"password3","r":"PYTHON DEMO OUTPUT,"d":"ya.ru"
"4":"[email protected]","p":"password4","r":"PYTHON DEMO OUTPUT","d":"yandex.ua"
"5":"[email protected]","p":"password5","r":"PYTHON DEMO OUTPUT","d":"yandex.by"
"6":"[email protected]","p":"password6","r":"PYTHON DEMO OUTPUT","d":"yahoo.com"
"7":"Demo_V;7829837","r":"PYTHON DEMO OUTPUT","d":null
"8":"[email protected]","p":"password8","r":"PYTHON DEMO OUTPUT","d":"gmail.com"
"9":"demo9_email@Tut.by","p":"password9","r":"PYTHON DEMO OUTPUT","d":"tut.by"
"10":"[email protected]","p":"password10","r":"PYTHON DEMO OUTPUT,"d":"t-online.de"

----------------------------------------------------------------------------------------

Output and safe in other file output.txt
Email : Password : Email Account Register with



[email protected]:password1:yahoo.com
[email protected]:password2:ymail.bg
[email protected]:password3:ya.ru
[email protected]:password4:yandex.ua
[email protected]:password5:yandex.by
[email protected]:password6:yahoo.com
[email protected]:password8:gmail.com
demo9_email@Tut.by:password9:tut.by
[email protected]:password10:t-online.de

use the function findall to match the email
re.findall(r'([a-z0-9]+(\.[a-z0-9]+)*@[a-z]+(\.[a-z]+)+)
Reply


Messages In This Thread
Help me with python read file and save file - by wereak - Apr-02-2019, 04:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  "[Errno 2] No such file or directory" (.py file) IbrahimBennani 12 465 Jun-12-2024, 03:29 PM
Last Post: snippsat
  Delete file with read-only permission, but write permission to parent folder cubei 6 22,355 Jun-01-2024, 07:22 AM
Last Post: Eleanorreo
  Cannot get cmd to print Python file Schauster 11 670 May-16-2024, 04:40 PM
Last Post: xMaxrayx
  Connecting to Remote Server to read contents of a file ChaitanyaSharma 1 401 May-03-2024, 07:23 AM
Last Post: Pedroski55
  Python openyxl not updating Excel file MrBean12 1 503 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Python logging RotatingFileHandler writes to random file after the first log rotation rawatg 0 524 Feb-15-2024, 11:15 AM
Last Post: rawatg
  Open/save file on Android frohr 0 433 Jan-24-2024, 06:28 PM
Last Post: frohr
  connect sql by python using txt. file dawid294 2 574 Jan-12-2024, 08:54 PM
Last Post: deanhystad
  file open "file not found error" shanoger 8 1,478 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Recommended way to read/create PDF file? Winfried 3 3,092 Nov-26-2023, 07:51 AM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

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