How to copy all .xls files from INBOUND folder in Unix

1k views Asked by At

I want to copy all .xls files only from the INBOUND folder to the target folder and convert all .xls files to .csv files.

Below is the code I wrote but it is not working properly.

#!/bin/bash
SRC_PATH=/bishare/IRP_PROJECT/SXM_SFTP/*/INBOUND/*
TGT_PATH=/appinfprd/bi/infogix/IA83/InfogixClient/Scripts/IRP/New_Vendors/Xls_Convert/

cp $SRC_PATH {*.xls} $TGT_PATH

cd $TGT_PATH

for i in
do 
ssconvert i i.csv
done
1

There are 1 answers

1
Zumo de Vidrio On

To copy all xls files:

cp /path_to_INBOUND/*.xls /path_to_target/.

To do some action with those files:

cd /path_to_target/
for i in *; do ssconvert i i.csv; done

(Supposing that ssconvert command works in that way, I don't know it)