Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
open FH, "<infile.txt" or die $!;
open OF, ">outputfile.txt";
while (<FH>) {
($key, @values)=split /\s+/, $_;
foreach (@values) {
print OF, "$key\t$_";
}
}
while (<FH>) { # read the file, line by line into $_
($key, @values)=split /\s+/, $_; set $key to the first item in the line, and the rest of the values gathered by the split get dumped into the array
foreach (@values) { # traverse the array, and output the key value, and each item in the array on a seperate line
print OF, "$key\t$_";
}
}