This question already has an answer here:
- How to print only last column? 9 answers
I am having a requirement where I need to extract couple of fields from a file with last field. structure of file can be different so cannot hardcode the last field. lets take example of two different files
another file File2
requirement can be like extract 1st and last field from file1 or requirement can be like extract 2nd and last field from file2
We get this requirement from a configuration table where they mention which field they want to extract but last field is common. one way is to use while loop but with out while loop is there any way that we can achieve this?