Thanks again.
Here's what I ended up with:
open(INFILE, "input.txt") or die
"Can't open input.txt: $!";
open(OUTFILE, ">output.txt") or die
"Can't open output.txt: $!";
my $prevKey = '';
while (<INFILE>) {
my ($field1, $field2) = split ',';
if ($field1 ne $prevkey) {
$prevkey =...
Thanks MillerH.
Sorry for my perl ignorance, but that seems like the entire program -
just need to save it as a pl file and run it -
how do i tell it to save the result as a txt file?
(Right now if I run it, it doesn't save the print to anywhere.)
Thanks much.
I have a text file in the format:
1,3
1,5
1,4
1,4.3
5,4
54,3
100,1
100,1
1100,2
etc
basically just two columns, comma separated.
I need to convert that into a text file with the format as follows:
1:
5
4
4.3
5:
4
54:
3
100:
1
1
1100:
2
etc
Column one appears once, followed by ':', with all...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.