Most viewed recipes tagged "split"http://code.activestate.com/recipes/tags/split/views/2016-03-15T19:07:35-07:00ActiveState Code RecipesSplit Strings w/ Multiple Separators (Python)
2011-03-20T20:33:13-07:00Kenneth Reitzhttp://code.activestate.com/recipes/users/4177394/http://code.activestate.com/recipes/577616-split-strings-w-multiple-separators/
<p style="color: grey">
Python
recipe 577616
by <a href="/recipes/users/4177394/">Kenneth Reitz</a>
(<a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/string/">string</a>, <a href="/recipes/tags/string_parsing/">string_parsing</a>).
Revision 5.
</p>
<p>Splits strings with multiple separators instead of one (e.g. <code>str.split()</code>).</p>
Split Up Text File by Line Count (Python)
2012-02-19T23:40:47-08:00Andrew Yurisichhttp://code.activestate.com/recipes/users/4180867/http://code.activestate.com/recipes/578045-split-up-text-file-by-line-count/
<p style="color: grey">
Python
recipe 578045
by <a href="/recipes/users/4180867/">Andrew Yurisich</a>
(<a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/text_files/">text_files</a>).
Revision 5.
</p>
<p>Splits a large text file into smaller ones, based on line count. Original file is unmodified.</p>
<p>Resulting text files are stored in the same directory as the original file.</p>
<p>Useful for breaking up text based logs or blocks of email logins into smaller parts.</p>
Unix-like split command in Python (simple version) (Python)
2016-03-14T22:35:05-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580620-unix-like-split-command-in-python-simple-version/
<p style="color: grey">
Python
recipe 580620
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/splitting/">splitting</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This recipe shows how to create a simple version of the Unix split command in Python. The split command splits an input file into multiple smaller files, the size of each of which is specified by a command-line argument giving the number of lines per file. This is useful for multiple purposes, such as editing large files in pieces, backing up files to small capacity storage devices, sending files across the network, etc.</p>
PDF Joiner / Splitter using wxPython, PyMuPDF (fitz / MuPDF) (Python)
2016-03-15T19:07:35-07:00Harald Liederhttp://code.activestate.com/recipes/users/4191581/http://code.activestate.com/recipes/580622-pdf-joiner-splitter-using-wxpython-pymupdf-fitz-mu/
<p style="color: grey">
Python
recipe 580622
by <a href="/recipes/users/4191581/">Harald Lieder</a>
(<a href="/recipes/tags/join/">join</a>, <a href="/recipes/tags/pdf/">pdf</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/split/">split</a>).
</p>
<p>Full featured PDF joiner. Join several PDF files into one output PDF. Page ranges can be specified as well as page orientation for each output page range. Tables of contents are intelligently preserved for each page range (can also be switched off).
Output PDF metadata editable.</p>
Path entire split & commonprefix (Python)
2011-04-06T20:29:46-07:00Maxime Fontenierhttp://code.activestate.com/recipes/users/4172150/http://code.activestate.com/recipes/577016-path-entire-split-commonprefix/
<p style="color: grey">
Python
recipe 577016
by <a href="/recipes/users/4172150/">Maxime Fontenier</a>
(<a href="/recipes/tags/commonprefix/">commonprefix</a>, <a href="/recipes/tags/path/">path</a>, <a href="/recipes/tags/split/">split</a>).
Revision 5.
</p>
<p>This recipe is a kind of extension to os.path
It offers an entire split function and a true commonprefix for paths.</p>
Script para transformar videos compatibles con reproductor MP4 (Python)
2010-04-30T18:23:39-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577210-script-para-transformar-videos-compatibles-con-rep/
<p style="color: grey">
Python
recipe 577210
by <a href="/recipes/users/4170207/">jrovegno</a>
(<a href="/recipes/tags/ffmpge/">ffmpge</a>, <a href="/recipes/tags/mencoder/">mencoder</a>, <a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/video/">video</a>).
Revision 3.
</p>
<p>Script para transformar videos compatibles con reproductor MP4:
MP4 2GB FUJITEL 80MP4TV2 MP4-TV (AVIConverter_320X240_20FPS_EN Setup.exe)
Requiere:
- ffmpeg - mencoder
Extras:
Divide video en partes de 10 min
Agrega subtÃtulos si existe el archivo file_name.srt
Uso:
avi2mp4 file_name.avi</p>
Python Easily Packetize / Slice / Chunk Text (Python)
2011-09-30T05:34:57-07:00__nerohttp://code.activestate.com/recipes/users/4177968/http://code.activestate.com/recipes/577885-python-easily-packetize-slice-chunk-text/
<p style="color: grey">
Python
recipe 577885
by <a href="/recipes/users/4177968/">__nero</a>
(<a href="/recipes/tags/chunk/">chunk</a>, <a href="/recipes/tags/packetize/">packetize</a>, <a href="/recipes/tags/regex/">regex</a>, <a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/udp/">udp</a>).
</p>
<p>I needed to chunk up some text to send over UDP and didn't want to have messy for loops with an if condition for size and then the little bit left over. All that struck me as very messy. I then thought of the re module and came up with a very simple solution to chunk up data.</p>
Split string sample (Batch)
2013-08-13T11:29:44-07:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578638-split-string-sample/
<p style="color: grey">
Batch
recipe 578638
by <a href="/recipes/users/4184115/">greg zakharov</a>
(<a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/string/">string</a>).
</p>
<p>Target: we have a task to split the string ("this is a string") on the characters. Possible solution:</p>