Python Forum

Full Version: Text file data to meaningful .csv conversion
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.