I don't really understand what you try to do.
Do you really need to create the files or it is just a [intermediate] step for the comparison/grouping/creating new large file?
You can read the file in the memory and have list of lists or list of tuples and compare whatever you want - you don't provide specifics.
Also in your last code snippet you specify ; as delimiter. Yet there are no ; in your sample file so it's not clear where it comes from
using csv module to read the csv file is ok
Do you really need to create the files or it is just a [intermediate] step for the comparison/grouping/creating new large file?
You can read the file in the memory and have list of lists or list of tuples and compare whatever you want - you don't provide specifics.
Also in your last code snippet you specify ; as delimiter. Yet there are no ; in your sample file so it's not clear where it comes from
using csv module to read the csv file is ok
with open("pj.csv", "r") as pj: reader = csv.reader(pj, delimiter=';') pj_csv = ['\t'.join(row) for row in reader]
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
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs