Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
split file
#2
I think everything is answered here: https://python-forum.io/Thread-utc-to-ce...8#pid81208
You have a blank line with many whitespaces. Use split without arguments. If your data is corrupt (blank lines/missing columns/too much), then put a use the split function in a try block, except ValueError and continue if this happens. Then this data is left out. When the format is wrong, it may end into a empty result Wall
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
split file - by mcgrim - May-22-2019, 08:17 PM
RE: split file - by DeaD_EyE - May-22-2019, 08:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to "tee" (=split) output to screen and into file? pstein 6 1,460 Jun-24-2023, 08:00 AM
Last Post: Gribouillis
  Split pdf in pypdf based upon file regex standenman 1 2,165 Feb-03-2023, 12:01 PM
Last Post: SpongeB0B
  How to split file by same values from column from imported CSV file? Paqqno 5 2,879 Mar-24-2022, 05:25 PM
Last Post: Paqqno
  [split] Results of this program in an excel file eisamabodian 1 1,617 Feb-11-2022, 03:18 PM
Last Post: snippsat
  split txt file data on the first column value shantanu97 2 2,486 Dec-29-2021, 05:03 PM
Last Post: DeaD_EyE
  [split] Help- converting file with pyton script eltomassito 6 3,340 Jul-02-2021, 05:29 PM
Last Post: snippsat
  Split Characters As Lines in File quest_ 3 2,566 Dec-28-2020, 09:31 AM
Last Post: quest_
  [split] How to convert the CSV text file into a txt file Pinto94 5 3,436 Dec-23-2020, 08:04 AM
Last Post: ndc85430
  Split and sort input file aawaleh 4 3,044 Apr-10-2020, 09:59 PM
Last Post: aawaleh
  Split csv file based on column value soli004 4 6,163 Oct-22-2019, 05:53 AM
Last Post: soli004

Forum Jump:

User Panel Messages

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