I cannot get past this step even though I followed the instructions from the hint.
"It worked. Instead of printing the content, you can pipe that output into a while loop so you can go through the rows one at a time. It looks like this:
cat course.csv | while read MAJOR COURSE
do
done"
Please help. Thank you.
Your code so far
cat courses.csv | while read MAJOR COURSE
do
echo $MAJOR
done
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
Challenge Information:
Learn SQL by Building a Student Database: Part 1 - Build a Student Database: Part 1
I apologize, I made a typo in the instructions inside of the double quotes. It should’ve been “courses.csv” which is what I had after the cat command.
When I run that while loop it prints the contents one line at a time so to me it looks like I performed the step correctly. Although, after I execute the while loop the lab is not letting me move onto the next step so I’m assuming I’m missing something.
The testing expectancy is very rigid and at times, it requires the exact match, including spaces or quotations (or lack of it), new lines…
It appears that the expected match would be, including spaces:
cat courses.csv | while read MAJOR COURSE
do
echo $MAJOR
done
As a way of obligation, I must explain that while this is the required code that the course forces, it was a concern on my part to see that it does perpetuate the misuse of cat as a command so broadly observed in forums. It this case, this code should be the recipient of the famous Useless use of cat award.
A corrected example would had been:
while read MAJOR COURSE
do
echo $MAJOR
done < courses.csv