World Cup Database - IFS=“,” not working properly(?)

Tell us what’s happening:

TLDR: IFS=“,” not working properly(?)

Hi, been working on the insert_data file but atm when the script has to insert the info into the teams table occurs an error bc of the characters extension (VARCHAR 20), thought my code was bad so tried to use the Student DB Pt1 insert script as reference, doing testing and as far as my understanding goes in the code:

cat games.csv | while IFS=“,” read YEAR
do
echo $YEAR
done

should display only the year of the games.csv but displays whole file

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0

Challenge Information:

World Cup Database - Build a World Cup Database

Compare these simplified examples to see how read behaves with different number of arguments (variables to assign to):

echo "Hello this world!" | while read VAR1; do echo $VAR1; done
echo "Hello this world!" | while read VAR1 VAR2; do echo $VAR2; done
echo "Hello this world!" | while read VAR1 VAR2 VAR3; do echo $VAR3; done
1 Like

:0!!! Thank you very much

I haven’t thought about declaring all the variables at once, in my mind it was enough to “just“ declare the ones needed at the moment for each table.