![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to combine text data into one line? | rcky_mntere | Shell Programming and Scripting | 2 | 05-02-2008 01:48 PM |
| Combine output on same line | theninja | Shell Programming and Scripting | 3 | 01-14-2008 04:21 AM |
| append a line to the last line in a file | subhrap.das | UNIX Desktop for Dummies Questions & Answers | 5 | 04-25-2007 09:17 AM |
| Using SED to append character to each line | c0nn0r | Shell Programming and Scripting | 4 | 07-08-2006 09:07 PM |
| append line | ymeyaw | UNIX for Dummies Questions & Answers | 7 | 04-09-2006 10:14 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Combine reports and append a line between each
I am new to Unix and have tried to write a ksh script to do the following without success:
I have several reports in a directory (report1, report2, report3, etc). I would like to combine all of these reports into one file (REPORTS). I would like to append *** End of Report *** to each report so I can easily distinguish between each report in the file. The output to the REPORTS file should look like: report1 *** End of Report *** report2 *** End of Report *** report3 *** End of Report *** Any help with this is greatly appreciated. |
|
||||
|
Thanks for the reply. I tried your suggestion ZB and I get the reports and then all of the ***End of Report*** messages at the end of the file:
report1 report2 report3 ***End of Report*** ***End of Report*** ***End of Report*** This is the code that I now have: #!/bin/sh myhome=/ebizImpact/ImpactServer-5_4/config/Cluster/DOCfrFTP # Move the Original .doc Word reports in DOCfrFTP/BAK to a tran file # Add an End of Report seperator between each report for FILE in $myhome/BAK/*.doc; do cat -q $myhome/BAK/$FILE >> $myhome/DOCfrFTP_`date +%Y%m%d`.doc.tran echo "*** END OF REPORT ***" >> $myhome/DOCfrFTP_`date +%Y%m%d`.doc.tran done rm -f $myhome/BAK/*.doc The code is pretty simple so you would think it would work. Anyway, thanks again in advance for any further suggestions. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|