I'm working on large files for wikisource, along with another guy. I generate a big text file (a few Mb) witch I format a bit using scripts, then I upload the text to a temporary page, where the other guy does some more formatting.My friends computer and internet connection are not the best in the market, and he asked me not to upload more than 400Kb of data, so his computer can handle all the text.the file is formatted like this:==header 1==...==header 2==...and has a few hundreds of headers.What I need to do:I need to yank at most 400Kb (as close as I can to this number), but I also need to yank all the text between headers - I can't have the text between headers to split over a few files.I can find the next header using \^={2}[^=]+={2}$, but I don't know how to carry on yanking until I have ~400Kb of data.Any ideas?
yanking a certain amount of bytes
cut copy paste
Ok, this is somewhat of a quick hack, let's hope it works:function! <SID>Chunk()     find first header    let l_start = search('\m^==[^=]\+==$', 'cW')    if !l_start         beep        execute normal \<Esc>        return    endif     translate to byte position    let b_start = line2byte(l_start)    if b_start < 0         beep        execute normal \<Esc>        return    endif     start marking    execute 'normal V'     mode 400 KB down    execute 'goto ' . (b_start + 400 * 1024)    if line('.') == line('$')        return    endif     find previous header    let l_end  = search('\m^==[^=]\+==$', 'bcsW', l_start)    if l_end <= l_start || l_end <= 0         not found         go to beginning of line        execute 'normal 0'         search next header        let l_end  = search('\m^==[^=]\+==$', 'sW')        if l_end <= 0             not found             go to end of file            execute 'normal G$'            return        endif    endif     move up    exec 'normal k$'    returnendfunctionnnoremap <silent> <leader>H :call <SID>Chunk()<CR>It marks the next ~400 KB region of full headers.  After yanking it you can go to the end of the marked region with '>.