I have a program that takes in a csv file which stores data in this format ` Lastname,Name,YYYYMMDD` (last bit is year month day for birthday) that only accepts **only gregorian calendar years** and I want my program to display all files which corresponds to the input month (string of the name of the month).
For instance, if the input month is "May", my program should display all files that have 05 in the MM section of the birthday.
Can anyone please help explain what should I ?
#!/bin/bash
echo "Enter csv file"
read file
echo "Enter month"
read month
cat "$file" | cut -f3 -d',' | // this line seperates the csv file and focuses on the 3rd argument, which are the birthdays
3
Answers
Seems like an ideal job for awk
month.awk is:
Using BASH:
Another version of the script showing use of positional parameters and/or default values for
month
andtarget_csv
:With GNU
date
(1) andgrep
(1), something like:help test