extract from table and stack in one list

I need help to extract data from one table and stack it into a list like below. I want to know each 3 digit no. in which days is Z and N.

this is the table:

NO. 1 2 3 4 5 6 7
123 Z N L L Z N L
234 L Z N L L Z N
345 L L Z N Z L Z
456 Z L L Z N L L
567 Z N L L Z N L
678 L Z N Z L Z N
789 N L Z N L N Z
890 N L L Z N L L

Result should be like this:

NO. Z/N YEAR MONTH DAY
123 Z 2017 1 1
456 Z 2017 1 1
567 Z 2017 1 1
789 N 2017 1 1
890 N 2017 1 1
234 Z 2017 1 2
678 Z 2017 1 2
123 N 2017 1 2
567 N 2017 1 2
345 Z 2017 1 3
789 Z 2017 1 3
234 N 2017 1 3
678 N 2017 1 3
456 Z 2017 1 4
678 Z 2017 1 4
890 Z 2017 1 4
345 N 2017 1 4
789 N 2017 1 4
123 Z 2017 1 5
345 Z 2017 1 5
567 Z 2017 1 5
456 N 2017 1 5
890 N 2017 1 5
234 Z 2017 1 6
678 Z 2017 1 6
123 N 2017 1 6
567 N 2017 1 6
789 N 2017 1 6
345 Z 2017 1 7
789 Z 2017 1 7
234 N 2017 1 7
678 N 2017 1 7

By: Doru D.

Leave a Reply

Your email address will not be published. Required fields are marked *