view admin/split_docstrings @ 12665:393b940d7ee2 octave-forge

pq_connection.h: Call register_type() only once.
author i7tiol
date Wed, 08 Jul 2015 13:54:27 +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