Python Forum
"Split" file and comparison with CSV
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Split" file and comparison with CSV
#4
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

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

Reply


Messages In This Thread
RE: "Split" file and comparison with CSV - by buran - Aug-07-2018, 07:25 AM
RE: "Split" file and comparison with CSV - by buran - Aug-07-2018, 08:49 AM
RE: "Split" file and comparison with CSV - by buran - Aug-07-2018, 08:58 AM
RE: "Split" file and comparison with CSV - by buran - Aug-07-2018, 09:49 AM
RE: "Split" file and comparison with CSV - by buran - Aug-07-2018, 10:04 AM
RE: "Split" file and comparison with CSV - by buran - Aug-07-2018, 10:08 AM
RE: "Split" file and comparison with CSV - by buran - Aug-07-2018, 10:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to "tee" (=split) output to screen and into file? pstein 6 1,528 Jun-24-2023, 08:00 AM
Last Post: Gribouillis
  Split pdf in pypdf based upon file regex standenman 1 2,232 Feb-03-2023, 12:01 PM
Last Post: SpongeB0B
Photo String comparison in a csv file in Python Pandas fleafy 2 1,241 Nov-18-2022, 09:38 PM
Last Post: fleafy
  How to split file by same values from column from imported CSV file? Paqqno 5 2,938 Mar-24-2022, 05:25 PM
Last Post: Paqqno
  [split] Results of this program in an excel file eisamabodian 1 1,648 Feb-11-2022, 03:18 PM
Last Post: snippsat
  split txt file data on the first column value shantanu97 2 2,526 Dec-29-2021, 05:03 PM
Last Post: DeaD_EyE
  [split] Help- converting file with pyton script eltomassito 6 3,388 Jul-02-2021, 05:29 PM
Last Post: snippsat
  Split Characters As Lines in File quest_ 3 2,609 Dec-28-2020, 09:31 AM
Last Post: quest_
  [split] How to convert the CSV text file into a txt file Pinto94 5 3,481 Dec-23-2020, 08:04 AM
Last Post: ndc85430
  Split and sort input file aawaleh 4 3,099 Apr-10-2020, 09:59 PM
Last Post: aawaleh

Forum Jump:

User Panel Messages

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