|
here is the code
Here is the code from notepad++.
Windows-based editor create a problem?
file2.txt
Code:
101 606 20. 15. 1. 1. 0.1 0.12 0.
101 606 1.2. 25. 3. 0.5. 0.5 0.22 0.
file3.txt
Code:
101 606 0.2 1.376 0.1 0.25 0.1 1.1
101 606 1. 12.76 3.1 1.0 1.1 2.1
shell script
Code:
#----------------------------------------------------------------------#
# Internal field separator to pipe. #
#----------------------------------------------------------------------#
IFS="|"
#----------------------------------------------------------------------#
# Counter for file name. #
#----------------------------------------------------------------------#
num=1
#----------------------------------------------------------------------#
# Paste parameter files together with pipe symbol. #
#----------------------------------------------------------------------#
paste -d\| file2.txt file3.txt |while read a b ; do
#----------------------------------------------------------------------#
# Create numbered configuration files. #
#----------------------------------------------------------------------#
cat << EOF > file$num.conf
PWAT-PARM1
*** < PLS> PETMAX PETMIN INFEXP INFILD DEEPFR BASETP AGWETP
*** x - x (deg F) (deg F)
$a
END PWAT-PARM1
PWAT-PARM2
*** <PLS > CEPSC UZSN NSUR INTFW IRC LZETP
*** x - x (in) (in) (1/day)
$b
END PWAT-PARM2
EOF
#----------------------------------------------------------------------#
# Next number... #
#----------------------------------------------------------------------#
(( num += 1 ))
done
|