I need to search for a csv and a dat file within a for loop then output them to a log table. I can do it individually but I want them together.
See below code:
check csv
count=0
for file in $(ls *.csv) ;
do
count=`expr $count + 1`
writelogf "$argv0: +%-50.50s+\n" $ul
writelogf "$argv0: |%-50.50s${cs}\n" "FILE IN"
writelogf "$argv0: +%-50.50s+\n" $ul
writelogf "$argv0: |%-50.50s${cs}\n" ${file%*}
writelogf "$argv0: +%-50.50s+\n" $ul
done
this gives me the following output:
x.sh: +--------------------------------------------------+
x.sh: |FILE IN |
x.sh: +--------------------------------------------------+
x.sh: |x.csv |
x.sh: +--------------------------------------------------+
I repeat the same type of code for the .dat files and get
x.sh: +--------------------------------------------------+
x.sh: |FILE OUT |
x.sh: +--------------------------------------------------+
x.sh: |x.dat |
x.sh: +--------------------------------------------------+
How can i merge together within one for loop to give me this output:
x.sh: +------------+------------+
x.sh: |FILE IN | FILE OUT |
x.sh: +------------+------------+
x.sh: |x.csv | x.dat |
x.sh: +------------+------------+
the table does not come out like i want it to on the post but you get the idea