Hi everyone, today I decide to learn Perl because its quick text processing capability.
I like to solve practical problem so here I'll show you how I solve each problem using Perl.
*Strawberry Perl 5 (windows) is used for this tutorial.
So in this problem, I have a column with alternative value such as
Elephan
10
Shark
12
Turtle
30
As you can see, odd row is the name and even row is the age of each animal. I want to separate odd and even row then save it as CSV file such as:
Animal | Ages |
---|---|
Elephan | 10 |
Shark | 12 |
Turtle | 30 |
First, assuming you already have Perl on your PC, we can run perl with one line by using
perl -e "<YOUR CODE>"