Can we do any merge like this automatically? All the Audit.txt into a single Audit.txt? I need to remove the headers and trailers in each file too. This is now being done manually and want to implement an automated way either using any shell script or Perl or Nant as we use Nant.
The files are appearing in the share drive as:
\Log\20120915\Audit.txt
\Log\20120916\Audit.txt
\Log\20120917\Audit.txt
\Log\20120918\Audit.txt
\Log\20120919\Audit.txt
File merge
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 41
- Joined: Tue Jan 24, 2006 3:43 pm
- Location: United States
- Contact:
File merge
Knowledge is Power
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 353
- Joined: Mon Jan 17, 2011 5:03 am
- Location: Mumbai, India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'd wager that what is being done manually is the file is being opened in a editor, the header and footer are being deleted and the file is then saved. As to how to automate that, I'd look into something like sed which could remove the header & footer and then stream the result to standard out which (as noted) works nicely in the Filter option of the Sequential File stage.
The complication is the fact that multiple files are involved. So you may need to loop the processing job and work with each file one by one, or script the filter command to create on consolidated file that the job processes and then deletes. One question in my mind for that approach is do you need to know the name of the source file in your processing? That answer would help differentiate the viable paths for you.
The complication is the fact that multiple files are involved. So you may need to loop the processing job and work with each file one by one, or script the filter command to create on consolidated file that the job processes and then deletes. One question in my mind for that approach is do you need to know the name of the source file in your processing? That answer would help differentiate the viable paths for you.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers