Python Forum
Text file data to meaningful .csv conversion
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text file data to meaningful .csv conversion
#1
Is there any python lib available to convert a text file with any format of data ( like data have key/value pairs and not fixed delimiters) into csv file. My end goal is to parse medical reports into csv data, reports includes paragraphs(column value) with headers(can be the column name). Is there any lib available, which will reduce the efforts to write wrapper arround it.
Reply
#2
Most probably you will need to write the parser yourself. At least I can not think of library that will parse ANY format of data.
It would help if you provide sample of the input data (Don't forget to replace any sensitive personal/medical info with dummy info). Also it would be good to know the source of the files (i.e. what software generate them). I think I have seen in the past python package to parse some sort of medical records, but right now I don't remember the exact medical software that generated them and the package I looked at at the time (it was a freelance project I applied to some years ago). I mean no matter how small chance is there might be a python parser already available.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  is this file an ASCII text file? Skaperen 5 3,674 Nov-08-2019, 08:44 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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