string find and delete line

I have search and delete something like this:

name: myvmname

device: Reader

Location: NomCluster

type: windows2003

name: myvmname2

device: Reader

Location: NomCluster

type: windows2003

..

...

etc...

...

I know that I probably have something like:

Get-Content myfile.txt | foreach-object {$_ - replace "device drive", ("")}

So my question is:

(1) is there a better way to remove the line "device: Reader.

(2) after the deletion of will there and empty space between "name and location ', if so is there a way to push the high place and all that?

(3) when I run the command I posted above, it does not change the file "myfile.txt, but statement instead of the screen has changed." How to change the file also with changes reported to the screen?

name: myvmname2

< - empty line - yuk!

Location: NomCluster

type: windows2003

more like what I want:

name: myvmname2

Location: NomCluster

type: windows2003

The following PowerShell script will remove the "device:" lines from a file named MyFile.txt:

Get-Content - Path myfile.txt |

Where-Object {$_-notlike "device: *"} |

Set-Content - Path mynewfile.txt

Remove-Item - Path MyFile.txt

Rename-Item - Path mynewfile.txt - NewName MyFile.txt

Tags: VMware

Similar Questions

  • CHKUPD loads at startup. How to find and delete this file?

    CHKUPD loads at startup. How to find and delete this file?

    CHKUPD loads at startup. How to find and delete this file?

    Not a matter of Microsoft/Windows.

    http://answers.Microsoft.com/en-us/search/search?searchterm=CHKUPD&CurrentScope.ForumName=Windows&CurrentScope.filter=windows_xp-files&askingquestion=false

  • How can I find and delete the app that keeps me close my office?

    Whenever I try to power off my desktop computer, I get a message that says "this app prevents you to close...". "or something. I don't know how to find and delete the app.

    Open the Task Manager by right clicking on the toolbar to see the programs running.

  • 1/3 of iMac HD taken by 'other '. How to find and delete?

    Hello.

    Screenshots below shows almost 700 GB of 'Other' via Info, disk utility and the about this Mac.

    I also used Omni drive Sweeper & he showed about 1 TB used; did not show the 'Other' Go 700.

    (Frustrating, reminds me of a similar common situation with my iPhone... space displayed as "Other" or "Docs & Data", without any way to identify and remove)

    • Why is this happening?
    • How can I find and remove?
    • How can I prevent it happening again?

    Thank you!

    Other = Email, Contacts, calendars, OS X and other things not in one of the categories with names.

    Be careful and identify before you delete

  • y at - it an easy way to find and delete the photos duplicated Gallery photo, or do I keep just scrolling and deleating

    I have several duplicate images and that you must remove to free up space ago filed either by date or name, and I thought that maybe there was a SHOW duplicates file as in itones

    Hello

    You will not be able to find duplicate files and remove all automatically. You must locate and remove it manually.

    There are several third-party programs that could help you find the duplicate on the computer files, and delete them. I suggest that you use your favorite search engine for these programs.

    DISCLAIMER of THIRD PARTY SOFTWARE: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    See also: http://windows.microsoft.com/en-US/windows-vista/Eliminate-duplicate-files

  • I am looking for an app to download which will find and delete the duplicate on my computer... If anyone can help...

    No good on this side of the computer... Computer works more slowly not as sharp as it was, I found a lot of files and duplicate files on it. Not understand or trust myself to remove anything manually.

    You might like to try these. Read their comments/user opinions 1-links provided:

    http://www.SnapFiles.com/reviews/CloneSpy/CloneSpy.html

    CloneSpy can help you recover hard disk space by detecting and removing duplicate files. It can find files that have the same exact content, regardless of their name, the date, time and location. CloneSpy is also able to search for files that are not identical, but have the same file name, allowing you to find and remove old versions of a file. Once the scan is completed, you can decide what you want to do with the found duplicates, CloneSpy you shows the details for each file (and its duplicate proposed) and allows to keep, move or delete.

    http://www.SnapFiles.com/reviews/duplicate-cleaner/duplicatecleaner.html

    Duplicate Cleaner is an easy to use program that helps you find and remove the duplicate computer files. You can search several structures of files at a time and set of criteria to identify duplicates. You can choose to search exact matches using the comparison of CRC or use the file name, size and date as the criterion. The program offers extended support for music files, allowing you to use the tag information ID (artist, title, album) to identify duplicate titles. The results are grouped together in a list and a selection wizard allows you to select quickly the files based on age, the audio quality, location and other aspects.

    See you soon.

    Mick Murphy - Microsoft partner

  • Find and delete unused images

    There be an easy way to find all the unused image files (or any other type of file) so that they can be managed - in my case deleted. I'm trying to clean up my site - get rid of unused files. I had a lot of selections for the images but used only a small part of them. I know that if I go one by one and delete items, she's going to tell me that they are related. But I have about 100 unused files, I'm looking for a way to automate. As in Flash - there is a county of its use.

    Help?

    Thanks, Dave

    Tuesday, June 24, 2008 17:16:31 + 0000 (UTC), "daveb45".
    wrote:

    > There must be an easy way to find all the unused (or any other image files
    (> file type) so that they can be managed - in my case deleted. I'm trying to
    > clean up my site - get rid of unused files. I had a lot of selections for
    > images used but only a small part of them. I know not if I a and
    > remove the items, she's going to tell me that they are related. But I have about 100 unused files
    > I am looking for a way to automate. As in Flash - there is a county of its use.
    >
    > help?
    >
    > Thanks, Dave

    Site | Check links

    Then look for orphaned files in the results panel

    --

    ~ Malcolm ~ *...
    ~*

  • How to find and delete the dupes in Photos

    How to find and remove the many dupes in Photos

    Duplicate Finder in the App Store will clean the photo library. However, I would be careful to make sure that nothing is really a duplicate.

  • How to find and delete empty folders in XP SP3?

    Is there a SECURITY program or process to find and remove all empty folders on my XP SP3 system?

    Is there a SECURITY program or process to find and remove all empty folders on my XP SP3 system?

    I suggest that you don't do that. Just because a file is empty does not mean that it is not part of an application installed or even Windows. If the folder is empty, it uses almost no space. Let him.

  • How to find and delete all the exact words

    How search and delete all the exact words, I tried adobe 11 Pro and I still need to know how to do this

    No, this feature in Acrobat Pro XI can remove all occurrences of the text you're looking for in a single operation.

  • find and delete blocks of text with the same geometricBounds

    Hi writer... .new question from here:

    mySelection var = app.activeDocument.selection [0] .geometricBounds;

    alert (mySelection);

    throughout the document, I need search and delete blocks of text with the same geometricBounds.

    If possible, the same dimensions, but not the same positions.

    Thanks for the help!

    OK Bala... .in to decimal differences, some executives have not been removed.

    I solved with "Math.round' instead of 'number '.

    ===================

    mySelection var = app.activeDocument.selection [0] .geometricBounds;

    var myWidth = Math.round(mySelection[3]-mySelection[1]);

    var myHeight = Math.round(mySelection[2]-mySelection[0]); Alert (myHeight);

    var allFrames = app.activeDocument.allPageItems;

    While (t = allFrames.pop ()) {}

    {if (t.IsValid)}

    var myTextframe = t.geometricBounds;

    var myTWidth = Math.round(myTextframe[3]-myTextframe[1]);

    var myTHeight = Math.round(myTextframe[2]-myTextframe[0]);

    If ((myWidth == myTWidth) & (myHeight == myTHeight)) {}

    t.Remove ();

    }

    }

    }

    ===================

    Now, your script works great!

    Thank you very much!

  • Find and delete the graphic lines of geometric limits

    Hello world

    I'm really desperate after days of web browsing and the forums that I still cannot understand this.

    I'm working on InDesign CS3 on a MacBook Pro with Snow Leopard.

    I have a catalog of 300 pages, set up thanks to a data merge. Unfortunately this way, I produce 2 graphic lines at the end of each page to which I would like rather to remove. Since I don't want to do it manually to each page and I'll have to set up this catalog quite frequently in the future I would like to remove these lines using Applescript.

    Since I have about 12 more of the same lines on each page (same style, color, stroke etc) I thought that the only way to tell which Applescript to remove is the geometrical limitations because these lines always run the same coordinates on each page.

    Unfortunately I can't understand it. I tried the following code:

    tell application "Adobe InDesign CS3"
         tell document 1
              repeat with oneFrame in (get graphic lines whose stroke weight = 1)
                   if geometric bounds of oneFrame is {0, 0, 0, 210} then
                        delete oneFrame
                   end if
              end repeat
         end tell
    end tell
    
    
    

    RESPONSE

    tell application "Adobe InDesign CS3"
         get every graphic line of document 1 whose stroke weight = 1
              --> {graphic line id 187 of page id 177 of spread id 172 of document "Untitled-16"}
         get geometric bounds of graphic line id 187 of page id 177 of spread id 172 of document "Untitled-16"
              --> {0.0, 0.0, 0.0, 210.0}
         delete graphic line id 187 of page id 177 of spread id 172 of document "Untitled-16"
    end tell
    
    
    

    It worked well for the line to x y 0mm 0mm with a length of 210mm.

    I tried the same thing with a line x 3mm y 134mm length of 210mm with the following code

    tell application "Adobe InDesign CS3"
         tell document 1
              repeat with oneFrame in (get graphic lines whose stroke weight = 1)
                   if geometric bounds of oneFrame is {134, 3, 134, 213} then
                        delete oneFrame
                   end if
              end repeat
         end tell
    end tell
    
    
    
    

    ANSWER:

    tell application "Adobe InDesign CS3"
         get every graphic line of document 1 whose stroke weight = 1
              --> {graphic line id 213 of page id 177 of spread id 172 of document "Untitled-16"}
         get geometric bounds of graphic line id 213 of page id 177 of spread id 172 of document "Untitled-16"
              --> {134.0, 3.0, 134.0, 213.0}
    end tell
    
    

    It was my best shot. No idea if I'm on the right track or totally out of bounds.

    Any help would be much appreciated!

    Thanks in advance...

    Osinho

    Take a look at that show the values for the geometric limits. These figures related to your x and is coordinated and you refer to them by their article in the list, for example, item 1 is the first "134,0" in your list, point 2 is called the "3.0", etc. So you need to refer to "that item 2 of geometric limits = [regardless of the value you're trying to match].

    If your document is very complicated, I think I would add another modifier to ensure that you get the right things, to say if these lines have a color that is not used on other graphic in the document lines, or if their weight of race is different, or even tests two items in the list of geometric limits if there is two that appear systematically in all the elements you want to delete - something for you make sure that you ONLY get references to the items that you want and are not likely to delete something, you need to keep.

    Good luck and welcome to AppleScript!

  • Repeat rows and deleting lines

    Good day everyone.

    It seems that I am stuck in an endless "loop" trying to figure out how to get a line to repeat without headers are repeated every time. So I have a delete button on each line. After adding a few lines, I can remove only 1 row, then when I try to remove the next line I get the wonderful "GeneralError.

    GeneralError: Operation failed.

    1. XFAObject.removeInstance:1:XFA:form1 [0]: #subform [0]: psl_list_subform [1]: Table3 [0]: Row1 [0]: del_but [0]: click

    The element [min] has violated its number of occurrences. I can only remove 1 line to be able to delete rows.

    I think it has to do with the headers to repeat.

    I am using LiveCycle Designer 8.0 (ver. 8.05.2073).

    These are the settings I use

    Psl_list_subform;

    Subform tab: allow Page Breaks content enabled

    Links: Subform Repeat for each data item Checked

    Min County "unaudited."

    Initials Count = 1

    Table 3

    Table tab: enable content "unaudited page breaks".

    Tab link: Repeat table for each data item is checked

    Min count = 1

    Initial number of rotations "unaudited."

    Header line

    Line tab: enable content "unaudited page breaks".

    The paging tab: include the line in the initial page "verified."

    Include the header row in the following pages "checked".

    The binding tab: line to repeat for each data Items 'checked '.

    Min count = 1

    Initial counter "unaudited."

    Rank 1

    Line tab: enable content "unaudited page breaks".

    Tab link: line of repetition for each data item "checked".

    Min count = 1

    Initial count = 2

    I try different combinations and does not always.

    Any help would be appreciated.

    Concerning

    Try this:

    Psl_list_subform - disable subform repeat (unless you are really repetitive of the entire subform - although this should not affect the table).

    Table 3 - disable Table again, you're probably not repeat the entire table.

    Header line - put offline of repetition, you don't want to repeat the header for each data item.

    Row1 - looks ok, you will get 2 rows to start and can only remove for a minimum of 1.

    The error you get is done your setting Min, hard to tell which was originally there. This is just to tell you that you try to delete something that is already at its minimum.

    Table headers can certainly be a pain sometimes! I had problems repeated on several pages.

  • Windows Media Player 11 has a way to find and delete the dupes

    Using Windows Media Player 11, is there a way to search and remove duplicate music files?

    Hi Ibedennis,

    You can try the following steps and check:

    Method 1:

    To resolve this problem, delete the Windows Media Player database. To do this, follow these steps:

    a. exit Windows Media Player.

    b. click Start, click run, type %LOCALAPPDATA%\Microsoft\Media Playerand then click OK.

    c. Select all files in the folder and then click on Delete on the file menu.

    Note: You don't have to remove the folders that are in this folder.

    d. restart Windows Media Player.

    Note: Windows Media Player automatically rebuilds the database.

    Method 2:

    If this does not resolve the problem, disable the Windows Media Player database cache files. To do this, follow these steps:

    a. exit Windows Media Player.

    b. click Start, click run, type %LOCALAPPDATA%\Microsoftand then click OK.

    c. Select the Media Player folder, and then click on Delete on the file menu.

    d. restart Windows Media Player.

    Note: Windows Media Player automatically rebuilds the database.

  • Where can I find / and delete the HD of a toshiba satellite 1620 CDS?

    I have a problem with my hard drive from my toshiba 1620.
    I want that he should be replaced, but when I unscrew the back cover of the laptop there is no way that I can remove the cover.
    Can someone tell me how to access the HD?

    With the best regards.

    Hello

    As far as I know the HARD drive is under the keyboard. Keyboard is fixed by 4 screws. Remove and turn the keyboard (face down) on the touchpad. You will see two screws that attach the HARD drive. I hope you know what you need to do now.

    Please be careful because all parts of this material are very sensitive and you can damage it. If you are not sure you can do it yourself, contact the Service partner. If you manage on the wrong path the pins on the HARD drive may be damaged.

    If you only do you it on your own risk.

    Good luck!

Maybe you are looking for

  • Satellite P20-driver for geforce fx go5200 cannot be installed

    I tried to install the latest drivers from nvidia.com (77.72_win2kxp_english_whql.exe) to upgrade my Satellite P20 - 832 who has a Geforce FX go5200. The installer said it was impossible to find any compatible card on my laptop. I was told 77.72 Nvid

  • Router Linksys AC3200 interfering with Tv Vizio E55 - C1

    I recently bought a router Linksys AC3200 and E55 - C1 Vizio TV. The remote for my tv button and the power of Vizio Vizio TV have been sporadic in their functionality. I did all the troublehsooting Vizio recommended on their site and finally called f

  • Update won't start windows

    Startup Repair lists autofailover and badpatch after that update won't start windows and not repairable auto. How to start to remove the last update?

  • Support KML for MapArgumernt

    Hello I want to know if the MapArgument that accepts KML url works fine or not. I downloaded a KML on the server and when I try to extract with MapArguments his work to the Simulator and by invoking the MAO with correct location. But the device is no

  • How to open a multi page. File TIF in Windows 8

    I can only view one page of a multiple page document.