-1

/need to read the 1st column and last of the excel file in linux environment.

Can some one help me with examples

1 Answers1

0

Your best bet would be to export the excel sheet as a CSV then manipulate it using awk or similar, such as:

awk -F"," '{print $1, $NF}' file.csv

For example:

# cat test.csv
hello, goodbye, seeya
# awk -F"," '{print $1, $NF}' test.csv
hello  seeya

Edit - For info, "$NF" is Number of Fields, so essentially 'last field'.

agc
  • 7,973
  • 2
  • 29
  • 50
McNandy
  • 23
  • 5
  • Actually, I would recommend a tab-delimited file as that may help avoid the troubles with quotes. – Gilbert Apr 15 '17 at 16:39