Python Forum
Reading Multiple text Files in pyhton
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading Multiple text Files in pyhton
#1
I have been working on .txt format files. Almost 13 k files and wanted to extract Age and gender from all the files in separate csv file . I have tired number of different methods but I'm unable to do that.
Pleas help me out.

Here is how does the data looks like:


Output:
A0002 12 500 5000 12-May-2020 12:33:59 A0002.mat 16+24 1000/mV 16 0 -1 -1 0 I A0002.mat 16+24 1000/mV 16 0 -15 22 0 II A0002.mat 16+24 1000/mV 16 0 -15 -8 0 III A0002.mat 16+24 1000/mV 16 0 7 5 0 aVR A0002.mat 16+24 1000/mV 16 0 8 23 0 aVL A0002.mat 16+24 1000/mV 16 0 -16 -21 0 aVF A0002.mat 16+24 1000/mV 16 0 44 16 0 V1 A0002.mat 16+24 1000/mV 16 0 71 -29 0 V2 A0002.mat 16+24 1000/mV 16 0 30 -38 0 V3 A0002.mat 16+24 1000/mV 16 0 0 11 0 V4 A0002.mat 16+24 1000/mV 16 0 -5 49 0 V5 A0002.mat 16+24 1000/mV 16 0 -11 32 0 V6 #Age: 49 #Sex: Female #Dx: 426783006 #Rx: Unknown #Hx: Unknown #Sx: Unknown
Larz60+ write Jun-25-2021, 07:46 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Output tags work for input as well. Added for you, please use bbcode tags on future posts.
Reply
#2
Please show some of the methods you have tried.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python convert multiple files to multiple lists MCL169 6 1,436 Nov-25-2023, 05:31 AM
Last Post: Iqratech
  Vlookup function in Pyhton antozas 1 590 Oct-02-2023, 04:16 AM
Last Post: vikraman
  splitting file into multiple files by searching for string AlphaInc 2 816 Jul-01-2023, 10:35 PM
Last Post: Pedroski55
  Merging multiple csv files with same X,Y,Z in each Auz_Pete 3 1,088 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 918 Feb-15-2023, 05:34 PM
Last Post: zsousa
  azure TTS from text files to mp3s mutantGOD 2 1,638 Jan-17-2023, 03:20 AM
Last Post: mutantGOD
  Find duplicate files in multiple directories Pavel_47 9 2,932 Dec-27-2022, 04:47 PM
Last Post: deanhystad
  Writing into 2 text files from the same function paul18fr 4 1,629 Jul-28-2022, 04:34 AM
Last Post: ndc85430
  Delete empty text files [SOLVED] AlphaInc 5 1,511 Jul-09-2022, 02:15 PM
Last Post: DeaD_EyE
Photo put a green boarder and text around multiple pictures jackosullivan 5 1,402 Jul-05-2022, 10:39 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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