Refer to the below file det.txt:
Name,Age,Location
a,10,chennai
b,20,bangalore
We will upload this file in pig and remove the headers during the load itself. Please refer to the below command that we will use:
register '/opt/cloudera/parcels/CDH/lib/pig/piggybank.jar';
A = LOAD 'det.txt' USING org.apache.pig.piggybank.storage.CSVExcelStorage(',', 'NO_MULTILINE', 'UNIX', 'SKIP_INPUT_HEADER');