-1

I am new to shell script so i don't any idea about this, please help me in this. In my scenario i have some excel files generated from mainframe which will update daily basis. my work is to write a code using shell scripting and parse the file and import some of the column into the MS Access database. How to do this?

Any help will be appreciate.

I am suppose to do using shell script but as this is new project i can use any other scripting to write the code and make the batch file so if any other way is best suited for this then please help me.

kajol
  • 41
  • 1
  • 7
  • Stack overflow is not made for us to provide code to you or a full tutorial, but to help you on something that went wrong. And be sure to read the [tour](/tour) :) – Ulysse BN Jul 12 '17 at 14:15

2 Answers2

0

You could use something like awk command like this: awk -F : (or whatever the excel file uses as a field separator) '{print $1, $2...}'. Once you have the field separator correct you use the '{print}' section to print the fields of the file that you want. After you've saved the file it should be ready for import into the database.

awk -F: '{print $1, $2}' /tmp/excel-file >/tmp/sorted

ShellGames
  • 83
  • 1
  • 7
  • This would require a CSV export from Excel, and it also doesn't solve the part about importing into MS Access at all. An .XLS file certainly cannot be parsed by a shell script as it's binary, and an .XLSX file is XML so you wouldn't want to use awk for that either. – Dale Jul 12 '17 at 23:10
0

See this page: https://mauriceausum.com/2015/07/12/automate-your-import-process-in-access/

it's from 2015 but the steps should be similar enough. No need for a shell script!

Dale
  • 534
  • 4
  • 13