Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7022939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:38:48+00:00 2026-05-27T23:38:48+00:00

I currently have a log file(see bellow) that I need to iterate through and

  • 0

I currently have a log file(see bellow) that I need to iterate through and pull out a list of files that were scanned. Then by using that list of files copy the scanned files into a different directory.

So in this case, it would go through and pull
c:\tools\baregrep.exe
c:\tools\baretail.exe
etc etc

and then move them to a folder, say c:\folder\SafeFolder with the same file structure

I wish I had a sample of what the output was on a failed scan, but this will get me a good head start and I can probably figure the rest out

Symantec Image of Log File

Thanks in advanced, I really appreciate any help that you can lend me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:38:49+00:00Added an answer on May 27, 2026 at 11:38 pm

    This should do the trick. Now, just adapt for your solution!

    public static void find(String logPath, String safeFolder) throws FileNotFoundException, IOException {
        ArrayList<File> files = new ArrayList<File>();
    
        BufferedReader br = new BufferedReader(new FileReader(logPath));
        StringBuilder sb = new StringBuilder();
        String line = null;
        while ((line = br.readLine()) != null) {
            Pattern pattern = Pattern.compile("'[a-zA-Z]:\\\\.+?'");
            Matcher matcher = pattern.matcher(line);
            if (matcher.matches()) {
            }
            if (matcher.find()) {
                files.add(new File(matcher.group()));
                System.out.println("Got a new file! " + files.get(files.size() - 1));
            }
        }
    
        for (File f : files) {
            // Make sure we get a file indeed
            if (f.exists()) {
                if (!f.renameTo(new File(safeFolder, f.getName()))) {
                    System.err.println("Unable to move file! " + f);
                }
            } else {
                System.out.println("I got a wrong file! " + f);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a txt file that has a change-log.I'm trying to display the new
Currently I have the function CreateLog() for creating a a log4net Log with name
I currently have an MS Access application that connects to a PostgreSQL database via
I am currently retrieving some information from a text file (.txt) that contains some
Is it safe to run LogParser against our live production IIS log file? Currently,
Currently I have a command that does this. First, upon the button click event
I have a site that uses subdirectories and currently only works when the trailing
I have an ASP.NET web form application that on the server side I need
I have a possibly long running program that currently has 4 processes, but could
I currently have speakers set up both in my office and in my living

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.