in reply to Text file processing question
Two lines should do the job:
#! perl -slw use strict; print "Name of consumer Subdivision Amount Type of work Phase"; printf "%-14s %14s %7.2f %-14s %-s\n", m[(\S+)\s+(\S+)\s+(\S+)\s+(.+)\s+(\S+)$] while <DATA>; __DATA__ Nancy Location1 600.00 New service Single Stella Location2 1000.00 Replacement Single Julie Location3 400.00 Replacement Three Debbie Location4 800.00 New service Three
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Text file processing question
by perl_seeker (Scribe) on Aug 13, 2009 at 12:35 UTC | |
by BrowserUk (Patriarch) on Aug 13, 2009 at 12:54 UTC | |
by perl_seeker (Scribe) on Dec 09, 2009 at 11:07 UTC | |
by BrowserUk (Patriarch) on Dec 09, 2009 at 12:45 UTC | |
by perl_seeker (Scribe) on Dec 15, 2009 at 07:48 UTC | |
by perl_seeker (Scribe) on Dec 21, 2009 at 10:21 UTC | |
|