Mercurial > forge
view admin/split_docstrings @ 12709:5dbe4f94a3d0 octave-forge
add Debian BuildRequires
author | abarth93 |
---|---|
date | Thu, 28 Jan 2016 20:15:15 +0000 |
parents | 3933841dc7f8 |
children |
line wrap: on
line source
#!/bin/sh file=$1 cat <<EOF | octave -q fid = fopen("$file","rt"); text = char(fread(fid,Inf,'uchar')); fclose(fid); section = [find(text == char(31))]; line = find(text == "\n"); section(length(section)+1) = line(length(line)) + 1; for idx=1:length(section)-1 lineend = min(line(line>section(idx))); name = text(section(idx)+1:lineend-1); body = text(lineend+1:section(idx+1)-1); fid = fopen(name',"wt"); fwrite(fid, body, 'uchar'); fclose(fid); end