![]() |
![]() |
We are currently migrating this forum over to our HelpSystems domain. Please post all new threads in our new HelpSystems Community Portal. |
![]() |
|
![]() |
AutoMate Discussion | ![]() |
help :
faq :
home
|
||
Latest News:
|
latest topics : statistics |
Topic Title: Concatenate oldest part of .txt file Topic Summary: Keep rolling 4 weeks' worth of text Created On: 04/23/2012 01:29 PM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
||||||||||
I have a log .txt file that shows user logons and includes the date. Each logon is placed into a new row. This file gets large, so we've been manually cutting/pasting the older logons in this .txt file to another archive .txt file.
What I'd like to figure out how to do is have Automate look at this file each day and just prune the logons that are more than 4 weeks old - moving those to the archive file. I know that this can be done, but my brain isn't coming up with a good way to accomplish it. Does anyone have any examples of pruning older data from a .txt file? Thanks, Mark
|
||||||||||
|
||||||||||
![]() |
||||||||||
Hi Mark,
Please provide a couple of the lines within the text so we know what you are working with as far as parsing the information.
------------------------- ![]() Leonard Amabile | Director, Cross Platform Support AutoMate | InterMapper | Skybot | Divisions of HelpSystems T: +1.213.738.1700 | F: +1.213.738.7665 |
||||||||||
|
||||||||||
![]() |
||||||||||
The log file contents look like this:
W-BP-DIV-0453 user1 Fri 04/20/2012 9:52:17.77 W-BP-DIV-IN0479 user2 Fri 04/20/2012 9:55:18.06 W-BP-DIV-CS0369 user3 Fri 04/20/2012 9:58:50.50 W-BP-DIV-CS0172 user4 Fri 04/20/2012 10:00:31.64 I was thinking that with the date stamped in there, and the fact that each entry is a new line, there has to be a relatively easy way to have Automate prune off the oldest entries and paste them at the end of an archive file. Thanks, Mark
|
||||||||||
|
||||||||||
![]() |
||||||||||
Hi Mark,
Are you able to format the text file so that the date displays as the first value?
------------------------- Liz Casale Technical Support Representative (213) 738-6966 Network Automation, Inc. -------------------------------------------------------------------------------- AM5 5.5.5.1; AM6 6.2.8.0; AM7 7.1.3.0; AM8 8.0.9.0; AM9 9.0.3.4 BPA7 7.1.3.0; BPA8 8.0.9.0; BPA9 9.0.3.4 |
||||||||||
|
AutoMate Discussion
» AUTOMATE » AutoMate 7
»
Concatenate oldest part of .txt file
|
![]() |
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.