I am trying to read an input file which has a fixed length of 300 bytes and each field in a record are delimited by "|" pipe symbol. For instance
Input file:
1|232|this is great|chennai|TN|604023|04/12/2018|12321.00|12312.00|N|this is for testing only|external remarks|0|0|3|Y|N|454.00|454.00
1|1232|this is great-o-great|Pune|MA|604023|04/11/2015|321.00|122.01|Y|this is for testing only|external remarks with comments|0|0|4|Y|N|54.00|14.00
1|8059|this is amazing|banglore|KA|298923|28/04/2013|321.00|662.00|N|this is for testing|external remarks|0|0|5|Y|N|344.00|984.00
1|092334|this is outstanding data|Mumbai|MA|23908043|18/08/2016|23321.00|656262.23|Y|this is for purely for testing only|external remarks|0|0|5|N|Y|323.00|1284.00
1|332|this is super|Pune|MA|6023|06/11/2010|9032.12|1233.01|Y|this is for testing only|comments|0|0|5|Y|N|154.00|124.00
1|1232|this is great-o-great|Pune|MA|604023|04/11/2015|321.00|122.01|Y|this is for testing only|external remarks with comments|0|0|4|Y|N|54.00|14.00
1|8059|this is amazing|banglore|KA|298923|28/04/2013|321.00|662.00|N|this is for testing|external remarks|0|0|5|Y|N|344.00|984.00
1|092334|this is outstanding data|Mumbai|MA|23908043|18/08/2016|23321.00|656262.23|Y|this is for purely for testing only|external remarks|0|0|5|N|Y|323.00|1284.00
1|332|this is super|Pune|MA|6023|06/11/2010|9032.12|1233.01|Y|this is for testing only|comments|0|0|5|Y|N|154.00|124.00
I want to include only specific FIXED columns of each record from the input file say 1st, 2nd, 4th, 5th, 6th,9th, 10th, 13th, 14th, 15th in the output file. Is there any option or way to select the records based on the column using the delimiter without fixed length record?
Kindly advice.