Python Forum
Extracting data from multiple txt files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extracting data from multiple txt files
#2
Yes. You probably would want a list of the roles. Then you could split the string at the colon and check if it's the right role. You would need a tracking variable to note that you are on the right role to get the following lines (like the second one in your example).

Note that we're not going to write your code for you, but we'll be happy to help you fix your code if you show it to us and clearly tell us what's wrong. But what I said above should get you started.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Extracting data from multiple txt files - by ichabod801 - Aug-23-2019, 02:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to generating multiple json files using python script dzgn989 4 274 May-10-2024, 03:09 PM
Last Post: deanhystad
  Is it possible to extract 1 or 2 bits of data from MS project files? cubangt 8 1,202 Feb-16-2024, 12:02 AM
Last Post: deanhystad
  python convert multiple files to multiple lists MCL169 6 1,692 Nov-25-2023, 05:31 AM
Last Post: Iqratech
  splitting file into multiple files by searching for string AlphaInc 2 979 Jul-01-2023, 10:35 PM
Last Post: Pedroski55
  script to calculate data in csv-files ledgreve 0 1,166 May-19-2023, 07:24 AM
Last Post: ledgreve
  Merging multiple csv files with same X,Y,Z in each Auz_Pete 3 1,261 Feb-21-2023, 04:21 AM
Last Post: Auz_Pete
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 1,005 Feb-15-2023, 05:34 PM
Last Post: zsousa
  Find duplicate files in multiple directories Pavel_47 9 3,286 Dec-27-2022, 04:47 PM
Last Post: deanhystad
  Extracting Data into Columns using pdfplumber arvin 17 5,887 Dec-17-2022, 11:59 AM
Last Post: arvin
  SQL Alchemy help to extract sql data into csv files mg24 1 1,874 Sep-30-2022, 04:43 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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