gon770 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to write a script that will merge text files into CSV (comma delimiter.)
FILE A: List of names separated by newline(\b)
FILE B: List of grades separated by newline(\b)
FILE A:
DAVID KIM
CHARLIE DOE
AARON PITTS
FILE B:
94
75
87
The script will create FILE C looks like below:
DAVID KIM,94
CHARLIE DOE,75
AARON PITTS,87
use warnings; use strict; use utf8; local $/ = undef; open FILE1, "myfile" or die "Couldn't open file: $!"; binmode FILE1; $string1 = <FILE1>; close FILE1; open FILE2, "myfile" or die "Couldn't open file: $!"; binmode FILE2; $string2 = <FILE2>; close FILE2; #and I got stuck here. I am thinking using "for" syntax, couldn't find + details. but can anybody help me?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Merging text file
by nemesdani (Friar) on Sep 05, 2012 at 22:09 UTC | |
by gon770 (Novice) on Sep 06, 2012 at 13:21 UTC | |
|
Re: Merging text file
by 2teez (Vicar) on Sep 06, 2012 at 05:06 UTC | |
by aaron_baugher (Curate) on Sep 06, 2012 at 16:01 UTC | |
by gon770 (Novice) on Sep 06, 2012 at 13:21 UTC | |
|
Re: Merging text file
by roboticus (Chancellor) on Sep 06, 2012 at 12:43 UTC | |
by gon770 (Novice) on Sep 06, 2012 at 13:20 UTC | |
|
Re: Merging text file
by aitap (Curate) on Sep 06, 2012 at 17:40 UTC |