I have the comma separated flat file whose contents are below.
Name,Empno,Address,Contact,Company
A,1,”BTM, Bangalore”,1234,”HCL”
B,2,”Tatanagar”,1243,”WIPRO”
C,3,”Patna”,1254,”CTS”
D,4,”Doranda,Ranchi”,1253,”TCS”
I need to get only Name and Contact for everyone. If I use delimiter as “,” the contact for A and D will be Bangalore and Ranchi which is incorrect. How can I get the 1st and 4th field.Also Please advise if I can use awk command to get the required details
EDIT Just to add this is sample data, my original data will have some more fields, also there can be comma at any field which is within quotes.
I assume contact is always last but one field. You can try this