Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 04/23/2012 01:29 PM
User is offline View Users Profile Print this message

Author Icon
MarkNorth
Student (5-19 posts)

Posts: 12
Joined: 11/09/2011

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

 Category Survey
 04/23/2012 02:54 PM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

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.





 Category Survey
AutoMate 7 version:
Windows version:


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 04/24/2012 12:41 PM
User is offline View Users Profile Print this message

Author Icon
MarkNorth
Student (5-19 posts)

Posts: 12
Joined: 11/09/2011

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

 Category Survey
 05/10/2012 04:28 PM
User is offline View Users Profile Print this message

Author Icon
Liz Casale
AUTOMATE EMPLOYEE

Posts: 940
Joined: 05/23/2011

Hi Mark,

Are you able to format the text file so that the date displays as the first value?

 Category Survey


-------------------------
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
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1389 guests browsing this forum, which makes a total of 1389 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog