The R Project SVN R

Rev

Rev 2160 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2160 Rev 6098
Line 5... Line 5...
5
# where FORMAT is the format string, typically "Ax Ay Az ..." with x, y,
5
# where FORMAT is the format string, typically "Ax Ay Az ..." with x, y,
6
# z etc being the widths of the columns and `A' means that the field is
6
# z etc being the widths of the columns and `A' means that the field is
7
# to be interpreted as an ASCII character string with trailing white
7
# to be interpreted as an ASCII character string with trailing white
8
# space suppressed, and SEP is the record separator to be inserted in
8
# space suppressed, and SEP is the record separator to be inserted in
9
# the output (default is a space).
9
# the output (default is a space).
10
require "getopts.pl";
10
#require "getopts.pl";
-
 
11
 
-
 
12
require 5.000;
-
 
13
use Getopt::Std;
-
 
14
 
11
&Getopts("f:s:");
15
getopts("f:s:");
12
die "A format string must be specified.\n" unless $opt_f;
16
die "A format string must be specified.\n" unless $opt_f;
13
$sep = $opt_s ? $opt_s : " ";
17
$sep = $opt_s ? $opt_s : " ";
14
while (<>) {
18
while (<>) {
15
    undef @rec;
19
    undef @rec;
16
    foreach (unpack($opt_f, $_)) {
20
    foreach (unpack($opt_f, $_)) {