Shell script prints more values than I want

This is the script:

while read f1 f2 f3 f4
        echo $f4,
done < users_test.csv

And the target file looks like this:

Type,Name,Email,User ID,Signed up,Last seen,Web sessions,Country,City

I need to get only the 4th value (under User ID). But with the script that I have written, I get the 4th value and everything after it.

I followed this tutorial. Any heads up on that one?

Source: bash

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.