I want some help on scripting regarding file processing.
I have a scenario in which I have 10 files. (file1.txt, file2.txt....) and they are in paricular format.
I want to read these files and append some text lines at the begining of each file and write this updated contents of each file in one paricular file (Combined_files.txt).
so, could you please give a script for this?
Please get back to me if I am not clear in explaining the situation.
Please treat it as urgent!
well....... do you have a 7x24 support contract with us?
here's something to start with - feel free to modify.
#!/bin/ksh
comb='Combined_files.txt'
\rm -rf "${comb}" 2> /dev/null
for file in *.txt
do
(
echo "Here's my header text line1"
echo "Here's my header text line1"
cat "${file}"
) >> "${comb}"
done