William James
10/25/2008 11:39:00 PM
Charles L. Snyder wrote:
> Case ID,DATE,SERIAL,NAME,Gender,Code1,Code2
> A822DEA04BA7814B011074A096C687B7,2008-09-05
> 10:28:38.47,1013726,Smith,Male,550.92 RED INGUINAL HERNIA,49500
> Inguinal Hernia Reducible >6 Months < 5 Years
> BEC7E6B8B4F0C53544BA9D2524A3746B,2008-09-04
> 10:29:47.81,1035331,Bailey,Male,752.51 UNDESCENDED TESTIS,54692 LAPS
> ORCHIOPEXY F/INTRA-ABDL TSTIS
DATA.each_line{|line|
ary = line.split(',').values_at(1,2,5,6).
map{|s| s[ /^\S*/ ] }
ary[0] = ary[0].split("-").map{|s| s.to_i}.
values_at(1,2,0).join("/")
puts ary.join(",")
}
__END__
A822DEA04BA7814B011074A096C687B7,2008-09-05
10:28:38.47,1013726,Smith,Male,550.92 RED INGUINAL HERNIA,49500
Inguinal Hernia Reducible >6 Months < 5 Years
BEC7E6B8B4F0C53544BA9D2524A3746B,2008-09-04
10:29:47.81,1035331,Bailey,Male,752.51 UNDESCENDED TESTIS,54692 LAPS
ORCHIOPEXY F/INTRA-ABDL TSTIS
--- output ---
9/5/2008,1013726,550.92,49500
9/4/2008,1035331,752.51,54692