Questions tagged [filesplitting]

87 questions
99
votes
1 answer

How to file split at a line number

I want to split a 400k line long log file from a particular line number. For this question, lets make this an arbitrary number 300k. Is there a linux command that allows me to do this (within the script)? I know split lets me split the file in equal…
denormalizer
  • 2,186
  • 3
  • 24
  • 36
11
votes
4 answers

How to split file on first empty line in a portable way in shell (e.g. using sed)?

I want to split a file containg HTTP response into two files: one containing only HTTP headers, and one containg the body of a message. For this I need to split a file into two on first empty line (or for UNIX tools on first line containing only CR…
Jakub Narębski
  • 309,089
  • 65
  • 217
  • 230
7
votes
3 answers

Get input file name in streaming hadoop program

I am able to find the name if the input file in a mapper class using FileSplit when writing the program in Java. Is there a corresponding way to do this when I write a program in Python (using streaming?) I found the following in the hadoop…
Krishnamurthy
  • 695
  • 2
  • 8
  • 17
6
votes
2 answers

How does Mercurial handle splitted files?

How does mercurial handle splitted files? What will happen if I create a branch and split a file. Can I easily pull changes from another branch which modifies the original, unsplitted file?
4
votes
1 answer

Split and copy a file from a bucket to another bucket, without downloading it locally

I'd like to split and copy a huge file from a bucket (gs://$SRC_BUCKET/$MY_HUGE_FILE) to another bucket (gs://$DST_BUCKET/), but without downloading the file locally. I expect to do this using only gsutil and shell commands. I'm looking for…
norbjd
  • 10,166
  • 4
  • 45
  • 80
4
votes
3 answers

How do I split a file in Git?

I have source file A, which is getting long and contains two large classes. I want to split it into files A and B, preserving history and "blame" data. In Subversion, this is very easy: do an svn copy A B, delete the lines from A that should only…
Myria
  • 3,372
  • 1
  • 24
  • 42
4
votes
3 answers

Split to volumes using batch

I am using the following command in a batch file in order to archive MY_LARGE_FOLDER and my .rar file is too big: WinRAR a -r D:\MY_LARGE_FOLDER.rar D:\MY_LARGE_FOLDER\*.txt D:\MY_LARGE_FOLDER\ How can I archive MY_LARGE_FOLDER, into small .rar…
Popa
  • 273
  • 1
  • 4
  • 13
3
votes
1 answer

How to include proper webpack bundles with multiple entry points?

What's the best way to automate the generation of (or even manually figure out) the script tags to use for an entry point in a multi-entry webpack setup? I'm setting up an MVC application to use webpack for an enormous number of javascript…
jpt
  • 162
  • 1
  • 11
3
votes
1 answer

Split audio file but only in pauses

I've been playting around with sox and using the trim command it should be fairly simple to split the whole audio into n parts (with a fixed length per part). However as I intend to split spoken recordings it might happen that a simple splitting…
leifg
  • 8,668
  • 13
  • 53
  • 79
2
votes
2 answers

Split a zip-file into chunks with Python

I have a piece of a code which creates a zip file successfully, but I need to split this file if the size of it is more that 1MB. I have this code but it doesn't work: from split_file_reader.split_file_writer import SplitFileWriter import…
Giorgi Injgia
  • 33
  • 1
  • 4
2
votes
2 answers

how to split a series in pandas based on another

I have two series in python pandas. One from values within a file called values.csv. It looks like this: time, value 0, 10312435 9, 45924523 11, 43423434 20, 42343552 ... Another one is called breaks.csv and it looks like…
ataraxis
  • 1,257
  • 1
  • 15
  • 30
2
votes
1 answer

How to split large Excel file into multiple Excel files using R

I'm looking for a way to split up a large Excel file into a number of smaller Excel files using R. Specifically, there are three things I would like to do: I have a large data set consisting of information regarding students (their school, the area…
Jonas8
  • 33
  • 6
2
votes
2 answers

Bash compute the letter suffix from the split command (i.e. integer into base 26 with letters)

The split command produces by default a file suffix of the form "aa" "ab" ... "by" "bz"... However in a script, I need to recover this suffix, starting from the file number as an integer (without globbing). I wrote the following code, but maybe bash…
PlasmaBinturong
  • 2,122
  • 20
  • 24
2
votes
4 answers

Splitting a file and its lines under Linux/bash

I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line. I could do this in Perl…
Sklivvz
  • 30,601
  • 24
  • 116
  • 172
2
votes
3 answers

Splitting data into alternating groups in python 2.7

day city temperature windspeed event 2017-01-01 new york 32 6 Rain 2017-01-02 new york 36 7 Sunny 2017-01-03 new york 28 12 Snow …
Lily
  • 55
  • 1
  • 8
1
2 3 4 5 6