CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [FishMonger] parsing a line of numbers: Edit Log



piper68
Novice

Mar 14, 2010, 1:06 PM


Views: 4435
Re: [FishMonger] parsing a line of numbers

I've tried this and works but is there a way to write this more simple? thanks.

perl -pe '/UTC[\s]+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/;$_=($1)?"$1,\n$2,\n$3,\n$4,\n$5,\n$6,\n$7,\n$8,\n$9,\n$10,\n$11,\n$12,\n$13,\n$14,\n$15,\n$16,\n$17,\n$18,\n$19,\n$20,\n$21,\n$22,\n$23,\n$24,":""' $TXT_PATH/a.txt > $TXT_PATH/b.txt


(This post was edited by piper68 on Mar 14, 2010, 1:07 PM)


Edit Log:
Post edited by piper68 (Novice) on Mar 14, 2010, 1:07 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives