This is not a bash/awk solution, but I recommend CSVKit, which can be installed by pip install csvkit
. It provides a collection of command line tools to work specifically with CSV, including csvcut, which does exactly what you ask for:
csvcut --columns=1,4 <
Output:
"abc@xyz.com,www.example.com",field4
def@xyz.com,field4
It strips the unnecessary quotes, which I suppose shouldn't be a problem.
Read the docs of CSVKit here on RTD. ThoughtBot has a nice little blog post introducing this tool, which is where I learnt about CSVKit.