-1

I'm migrating some of old bash scripts to python, both for utilitar and educational purposes. In Bash i'd use something like

cat dir/*csv|split -n5 -d --filter="gzip -c - >$FILE.gz" -L20000 - combined/part-

and get directory with number of archived files with correct number of records each.

I'm wondering what library or approach in Python would behave in a similar way to gnu split?

Robert Navado
  • 1,319
  • 11
  • 14

1 Answers1

-2

python has a default split method for string type. for example: msg = "this:is:a:message" result = msg.split(":")

result will be a list as follow: ["this", "is", "a", "message"]

Gu Hang
  • 21
  • 2