in reply to working with non-delimited files
You want to know about the /g modifier. Read about it in perldoc perlre:
Update: on a second reading you probably want (code updated to reflect the change):
#!/usr/bin/perl use strict; use warnings; while (my $line=<DATA>) { $line =~ s/\s+/|/ for 1..5; print $line; } __DATA__ This# is stand alone data "but this data needs to , sta +y together/ and here is some more -but this is a single column
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: working with non-delimited files
by FunkyMonk (Bishop) on May 24, 2007 at 21:28 UTC | |
by blazar (Canon) on May 24, 2007 at 21:50 UTC |