Writing a batch file which will remove some files?

I'm writing a batch file which will remove some files based on a list in a text file. Each line lists a different file and a single line of the content of the files, as below:

m:\trumpf3\ncdone\rueck090.txt:da,'1599','159934','159903400',1,1,1934
m:\trumpf3\ncdone\rueck091.txt:da,'1599','159935','159903500',1,1,3518
m:\trumpf3\ncdone\rueck092.txt:da,'CP_TAPESHOT',1
m:\trumpf3\ncdone\rueck093.txt:da,'CP_TAPESHOT',1

m:\trumpf4\ncdone\rueck440.txt:da,'*','480','0017341',1,1,2288, "
m:\trumpf4\ncdone\rueck441.txt:da,'*','500','0017343',1,1,3705, "
m:\trumpf4\ncdone\rueck442.txt:da,'*','510','0017344',1,1,3628, "
m:\trumpf5\ncdone\rueck494.txt:da,'2179','217901','217900100',1,1,1500, "
m:\trumpf5\ncdone\rueck495.txt:da,'2179','217902','217900200',1,1,707, "
m:\trumpf5\ncdone\rueck496.txt:da,'2178','217801','217800100',1,1,1042, "
m:\trumpf5\ncdone\rueck497.txt:da,'2178','217802','217800200',1,1,1383, "

The first and the second file are two good files, however the third and fourth, I didn't need. At this point, I'll have to go through the list of files and manually delete each one that does not match the format of 1 & 2. They are in different folders, but I think that the path at the beginning should be able to make the batch to delete this file. I can just find a way so that it can go through the list in the text file. Any help would be greatly appreciated because that would be a huge timesaver.

Well, I think even more easy.  Paste the whole lot into Excel to make it easier to handle. You can filter the lines manually, or write a formula next to him who decides whether the line should be understood, something like this:

I don't know what criteria would you use, so I used 'if the number after that the parenthesis after the first comma is a number, keep the line."  The text surrounded by a circle is the text that I check to see if it is a number:

Tags: Windows

Similar Questions

  • Thunderbird 38 which will remove one of my IMAP accounts

    I've used TB for years and currently have 4 hanging IMAP accounts. When updated Thunderbird updated to v38 recently, one of the accounts has stopped working. After days of troubleshooting and modification of account settings, I drove back to v37 and works account again once she did. Any idea what could happen? Should I submit a bug for this issue?

    A few details:
    -I am running Windows 7
    -Temporarily disabled my firewall, which has no effect on the question
    -L' e-mail address is linked to a server of the company (no problem outside TB)
    -When you try to receive mail in v38, no error is given, it expires just
    -When you try to add the account in v38, TB asked if the user name or password is incorrect

    Thank you!

    Guessing now that this is related to increased security in TB related to the attack of the impasse earlier this year. Maybe the server of our company needs a security update.

    You hit the nail on the head. See https://support.mozilla.org/en-US/questions/1072942#answer-755678

  • Why the installer will remove old CC apps?

    I have older CC apps for open (even some old pagemaker files) very old files and some files that are open not correctly in the current version. Why the app Setup 2015 will remove legacy applications? Is there a work around? I have to cancel my membership and return to individual applications or installation which will remove also old apps?

    I found an answer here: Creative Cloud offering more choice for Installations. Adobe Customer Care Team

  • Hi, manually remove some files in WINSXS, which files are safe to remove?

    Hi, manually remove some files in WINSXS, which files are safe to remove?

    No, really.

    http://support.Microsoft.com/?kbid=2592038

  • How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    I recently had to format my hard drive and reinstall iTunes 12.3.2.35 on my Win7 PC. As part of the re - install iTunes, I clicked on the button scan for music.  This has created duplicates several of my songs.  I deleted then the duplicate songs from iTunes, but when I went to play a few songs a pop-up said "the song would not be because the original could not be found.  You want to locate? "When I tried to locate the song it is not found, but when I pulled the songs out of the trash they could be found.

    How can I keep the original and remove any duplicate songs in iTunes on PC Win7 which took place after iTunes to scan for music during a re - install?

    iTunes can create duplicates if the same content is added several times from outside the media folder when it is about to make copies of everything that is added to the library, or is added from an external drive that hosts the press kit that was disconnected during the launch of iTunes.

    Official notice of Apple on the duplicates is here: find and remove duplicates in your iTunes library. This is a manual process and article fails to explain some of the potential pitfalls such as the lost coast and membership of playlist, or sometimes the same file can be represented by multiple entries in the library as well as a removal and recycling the file will break all the others.

    Use MAJ > display > show items to reproduce exactly to display the duplicates because it is normally a selection more useful. You must manually select all but one of each group to remove. Sort the list by Date added can make easier select appropriate tracks, but it works better when executed immediately after the dupes were created.  If you have several entries in iTunes connected to a same file on the disk hard then don't not send to trash.

    Use my DeDuper script (Windows only) If you are not sure, do not want to do it by hand, or want to maintain ratings, play counts and playlist membership. See this background thread , this post for detailed instructions and Please take note of the warning to back up your library before deduping.

    (If you don't see the menu bar press ALT to temporarily view or CTRL + B to keep displayed.)

    The latest version of the script can put away the dead links as long as there is at least a double live to merge his stats and membership of the playlist and must deal wisely when the same file has been added through multiple paths.

    TT2

  • I want to make a batch file, so I can save some files on another disk

    On XP, you can make one. BAT file with a text editor and it will work.  On XP Professional the. BAT file that make you in word processor does not work.  Can someone help me please?

    The game, 13 Sep 2012 22:41:40 + 0000, older2 wrote:

    On XP, you can make one. BAT file with a text editor and it will work.  On XP Professional the. BAT file that make you in word processor does not work.  Can someone help me please?

    Sorry, but what you say above is not correct. This has nothing to do
    What version of Windows you are running, or which edition of this version
    Windows that you are running. It has to do with your word processor and how you
    use it.

    What treatment do you use?
    A batch file must be a text file, not a file Microsoft Word .doc, one
    File WordPerfect .wpd, .rtf file, or any other type of Word
    file processor. In addition, it must have the extension. bat.

    You must save the file with one save slot, not a backup and make sure that
    that it is saved as a text file with the extension. bat.

    Moreover, in general, almost any word processing is a bad choice for
    creation of batch files. A text editor such as Notepad that comes with
    Windows, is much easier to use for this purpose and is a much better
    choice.

    Ken Blake, Microsoft MVP

  • I'm trying to install Acrobat 8 Std on a laptop computer that was in need of a restoration.  He asks the file AdobePDF.dll since my Vista CD - I do not have.  How can I get this file or another which will allow my Acrobat 8 work on this laptop with Win 8

    I'm trying to install Acrobat 8 Std on a laptop computer that was in need of a restoration.  He asks the file AdobePDF.dll since my Vista CD - I do not have.  How can I get this file or another which will allow my Acrobat 8 work on this laptop with Win 8.1, which she did before restoring?

    John,

    AdobePDF.dll is in the file Data1.cab. Mine is located in C:\Program Files (x 86) \Adobe\Acrobat8\Adobe Acrobat 8 Professional\ You need to extract the file "AdobePDF.dll_64" from the .cab file. You can do this with WinZip or 7-Zip. Everything you need to extract is this file, nothing else... Once you have extracted it, remove the _64, so the name of the file is AdobePDF.dll. Then place the file in any location you want and run the program it when asked. For a file location, I suggest to C:\Program Files (x 86) \Adobe\Acrobat8\

    Hope that helps.

  • A script that will count the total number of pages into multiple PDF files in a batch file?

    Is there a script I can use ExtendScript Toolkit that will count the total number of pages into multiple PDF files in a batch file?

    In another discussion I showed a JavaScript that you can use to write the number of pages to the console in a batch sequence. You would do exactly the same thing in Action, so the action would consist of a simple JavaScript (more tools > run JavaScript) which includes the code.

  • If I can put a music file in which will start playing when the mail is opened

    I want to put a music file in the body of the email which will start playing when the emaii is opened please let me
    whether it is possible in Thunderbird mail
    Thank you

    See this: http://forums.mozillazine.org/viewtopic.php?f=39 & t = 79970 & start = 0

    I must say that I am not convinced that by using the specified HTML it could succeed to set the file musical itself. He would probably play if the sender displayed to himself and he opened on his own computer, because the file is local (always assuming that its authorized e-mail client reading.)

    Note that Thunderbird will not particularly play music embedded in messages, so if someone you send to use Thunderbird, they don't hear it.

    It is one of the reasons why I use Thunderbird. Besides having always cut sound. It can be very annoying having noise suddenly pop out of your computer in the workplace.

  • How can I remove a program which will not move to trash?

    How can I remove a program which will not move to trash?

    What program? If she has an uninstall program, which allows to remove it.

  • Error - can open the file install.log, unable to remove some programs.

    Original title: can not open install.log file.

    I am trying to clean my computer, because it is really slow. I tried to remove some programs and I keep getting this message, "could not open install.log file". Is anyway to fix this?

    Hi njfay,

    The programs that you are trying to uninstall?

    You can run the disk cleanup tool and check if the problem persists.

    Description of the tool in Windows XP disk cleanup

    Reference: optimize the performance of your computer

    Hope the helps of information. Please post back and we do know.
    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Pass systgem of exploitation and the files associated with a second disc which will now be the C drive.

    My computer has a hard disk of 120 GB with 3 partitions: C, D, e. using Windows XP Pro.  The C; drive is running out of room and I don't want to repartition the disk.  I bought a 320 GB drive to use as a new drive.  What is the best way to move everything to the new drive, which will be at the same time as the old disk of the computer.  In the old days BACK I'd use copysys to ensure that the operating system has been installed correctly.  If I just copy with just the correct drive, this will bring on any system files or tracks so that I can make the new drive to my new C drive?  Thank you for your suggestions.

    No, you can't just copy the files. The new drive will come with a cloning utility (or you can get one on the disc mftr. site) to clone the old hard drive to the new. Cloning is an exact copy. If you don't want an exact copy because you don't want to partition the old drive in the same way, the image of your system partition instead, save the image to an external hard drive. I prefer Acronis True Image . Then, you can install your new hard drive, the boot with the Acronis rescue CD and apply the image as you did. TI can also make additional imagery that makes a recovery program very good backup or disaster. MS - MVP - Elephant Boy computers - don't panic!

  • Vista, backups of files on a disk of Bookshelf (1. 5 t), worked, removed some daily newspapers (household), now get backup error: 0x80070005

    I am running Vista and make backups of files on a disk of Bookshelf (1. 5 t).  Everything went well (completing daily backups).  I tried to clean up by removing some daily file backups when I received the following error message: 0x80070005.  I think that what I did is to delete the files backup complete.  Now, I can't do a backup of files daily or full without getting the same error.  Any ideas?  Is it possible I can take all of the information off my shelf drive backup and start over again - as I have had to do originally?

    Hello

    This is a forum for microsoft at the link specifically for backup questions below

    http://social.technet.Microsoft.com/forums/en-us/WindowsBackup/threads

  • Windows 7 will not allow a batch file to run.

    I created a batch file.  Double-clicking it in Explorer lights up only the Publisher.  It runs in a command window does the editor.  That is what it is?

    Should it run in Compatibility Mode for Windows XP (SP3) maybe? Right click, select Properties , and then make the changes in the compatibility tab.

    You didn't mention what your batch file has been written to do, but it must run an command with administrator privileges prompt?

    To start an elevated command prompt, click Start and type CMD but do not press ENTER. Find the program listed above CMD and right click and select run as administrator.

    If this does not work the script file, you will need to click right on the. BAT or. CMD and select Properties. Under the tab compatibility , under privilege level, check the run as Administrator option. This should be performed by the users of the human resources of the computer, click on change settings for all users and make your changes as well.

    • If this proposal of solution solves your problem, please go back and mark as answer for others to consider.
  • Create the batch file to remove log files in Windows

    We are running Oracle 11 G under Windows 2008 R2. For free tickets, we run daily from rman commands manually. I would like to create a batch to do it automatically. This is the batch file that I created.

    The echo Yes | Del Y:\Orace11g\temp\*.*

    Robocopy D:\Relius\Admin\RADB\ArchiveLogFiles\ Y:\Orace11G\temp\ b / mining: 3

    RMAN

    connect sys@radb target;

    password

    overlap archivelog all;

    remove expired archivelog all;

    Yes

    but it stops at rman

    C:\ > rman

    Recovery Manager: release 11.2.0.1.0 - Production on Mar 21 10:49:27 Oct 2014

    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

    RMAN >

    What is the correct way to cerate the batch file to delete the expired archivelogs?

    Hello

    It is not a problem of RMAN, but is that a batch under windows creation/configuration is the problem.

    See this URL, how do I Configure a tasks scheduled under Windows 2008 R2.

    -Next, create a file .bat with your instructions:

    Set ORACLE_SID = radb

    set ORACLE_HOME = c:\dbhome

    RMAN cmdfilemyrmancommands.csv msglog = sys/PASSWD@radb target = c:\log.log

    - Then put your RMAN commands in the file myrmancommands.csv

    Run {}

    devote to the disc channel type c1:

    overlap archivelog all;

    remove expired archivelog all;

    output channel c1;

    }

    Best regards

Maybe you are looking for