in reply to Need help with regex to replace 4th \s with \n in data line
#!/usr/bin/perl -wl use strict; my $str = "School of Wisdom and Knowledge College Preparatory"; my $pos = 0; $pos = 1 + index $str, " ", $pos for 1..4; substr $str, $pos -1, 1, "\n" if $pos; print $str;
--
John.
|
|---|