in reply to Add - in between number in a file
I'm guessing you have 9 digit numbers and you want to format them with hyphens. If so then perhaps unpack and join
poj#!perl use strict; use warnings; while (<DATA>){ my $str = join '-',unpack 'a3a2a4',$_; printf "%s\n",$str; } __DATA__ 458430764 453453214 462634878 453990002 462755714 631036456 466917461 467172570 454691673 258611036
|
|---|