Compare 2 Script Files

when i want to compare 2 Script Files i always have to use Notepad++
Please include this Funktion into the Script Editor

Thanks Adam...I got this script & its getting almost closer to what I would like, but thing that I am trying to find is - the similar values (from 2 files) to show in the output screen when this script is run 
I saved a file1 called test1.txt (Contents below) in C:

5
6
7
8
9
a file2 called test2.txt (Contents below) in C:
1
2
3
4
5
Here is the script - 
$text1 = Read-Host "Enter file one"
$text2 = Read-Host "Enter file two"
foreach ($text1 in $text2)
Compare-Object -ReferenceObject (Get-Content $text1) -ExcludeDifferent (Get-Content $text2) -IncludeEqual
When I save and run the script, I got the input to enter the file1: C:\text1.txt & input to enter the file2: C:\test2.txt & then as result I am getting output 1 2 3 4 5 
But I wanted to get the similar values in those 2 files which is 4, 5
Any help pls let me know...
VT

Similar Messages

  • Invoking Beyond Compare script using TFS build script

    Hi,
    As a part of automated build process in TFS I used invoke-process activity to run Beyond Compare script to generate report for comparing different versions of same xls file. Report was never created. I had gone through the tfs build log and it does not show
    any error but with result = 0 ( as far as the beyond script is concerned "result=0" is successful). I compared same file of different versions manually on the same build server using beyond compare, it works like a gem resulting xml report. Same
    TFS build process for other format files like .csv and .txt works smoothly generating xml report. The only issue is with .xls files. 
    If not Beyond Compare is the right one to call its script from TFS build process, is there any other tool or software that fits to my requirement? I need your guidance and help to take it forward.
    FYI, We are using TFS 2010 and Beyond Comapare pro 3.3.3
    Thanks
    Adithya

    Hi Adithya, 
    Thanks for your post.
    In your build definition, change the Logging Verbosity =
    Diagnostic, then queue your build definition, after build run completed, you can find the build in
    Build Explorer, then open build in VS, under View Log section to check which command line be executed in your invoke-process activity section. Then logon your build agent machine, and try to execute the same command line, ensure
    the command line can be executed correctly and you will receive the expected result.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Script File comparison

    Hi,
    When I am using FileMerge and compare two different versions of a script file, it says "Files are not ASCII", if I 'proceed anyway' I am seeing lots of special characters.
    How can I do a better file comparison(.scpt)?
    regards
    Mowri

    Here's a very basic script that will accomplish what you're asking:
    <pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
    title="Copy this code and paste it into your Script Editor application.">set tmpDir to do shell script "mktemp -d /tmp/CompareScripts.XXXXXXXXX"
    set leftFile to tmpDir & "/left"
    set rightFile to tmpDir & "/right"
    set script1 to quoted form of POSIX path of (choose file)
    set script2 to quoted form of POSIX path of (choose file)
    do shell script "osadecompile " & script1 & ">" & leftFile & ¬
    ";osadecompile " & script2 & ">" & rightFile & ¬
    ";/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge -left " & ¬
    leftFile & " -right " & rightFile & ";rm -rd " & tmpDir</pre>
    This script is very basic and has no error checking incorporated. Here's what the script does when run:
    1) Creates a uniquely named directory in the "/tmp" directory.
    2) Asks you to locate script file #1 (left file for FileMerge comparison).
    3) Asks you to locate script file #2 (right file for FileMerge comparison).
    4) Launches FileMerge and loads the 2 files for comparison.
    5) Deletes the directory it created in the beginning when you quit FileMerge.
    The script will continue to run until you quit FileMerge. The script can be modified in many different ways depending on the exact task you'd like for it to achieve. You can also modify the script to be a droplet so you can just drop 2 scripts on it for comparison.
    Hope this at least gets you started in the right direction.

  • Error unable to open script file

    I have been using DW8 since it came out. I am running Windows 7. Everything was working fine until I had hard drive failure. Replaced hard drive reinstalled Windows and DW8. Now when I try to insert an image I get the message "unable to open java script file c:\program files\Macromedia\Dreamweaver 8\configuration\objects\common\AccessibleImage.js (error 2)".
    I have done the usual--rename config file--reinstall DW8--clean register and reinstall--run as admin.--run in compatibility with XP SP2, etc. but nothing works.
    Help would be invaluable to me.

    Your version isn't listed here but something on this page may help you...
    http://helpx.adobe.com/dreamweaver/kb/troubleshoot-javascript-errors-dreamweaver-cs4.html

  • How to Print Post Script Files

    Hi All,
    I am trying to make a utility software in foxpro that could print post script file on:-
    1) Post script printer
    2) Non Post Script printer
    Operating System Windows 95 & above
    Help is requested from all the community members
    Reagards
    Harsh

    PostScript printer - send it to the printer port e.g. LPT1: with a simple copy.
    Non-PostScript printer - you'll need to buy a PostScript RIP, or perhaps use Acrobat Distiller to convert the PostScript to PDF, then print the PDF with Acrobat's API - see the Acrobat SDK. (This is not possible with the free Reader).

  • How can I assign a action to a button of the many scripts in the script file.

    How can I assign one action of many actions in a script file.
    I have many actions in a script file and I want to run one of them by clicking a button on the panel. However, loading the script I can not isolate the action that interests me.

    Hello,
    Try System Preferences>Energy Saver>Options tab, uncheck Allow power button to sleep computer.
    Some possible other options...
    Control-Eject
    The dialog box "Are you sure you want to shut down your computer now?" appears with options to Restart, Sleep, Cancel or Shut Down. After the dialog appears, press the R key to Restart, press the S key to Sleep, press the Esc key to Cancel, or press the Return key to Shut Down.
    Control-Command-Eject
    Quits all applications (after giving you a chance to save changes to open documents) and restarts the computer.
    Control-Option-Command-Eject
    Quits all applications (after giving you a chance to save changes to open documents) and shuts the computer down.
    Command-Option-Eject
    Puts the computer to sleep.
    Shift-Control-Eject
    Puts all displays to sleep.
    Power button (if the computer is not responding)
    Press and hold the power button on the computer for six seconds to shut down the computer.
    http://support.apple.com/kb/ht2448

  • How can you detect (from a script file) that javac found problems?

    The subject line says it all, but the background is:
    I have a script file (.bat, since am stuck on windoze for the moment) which is doing some compilation using javac.
    I would like to skip all subsequent activities in the script file after the call to javac if any file failed to compile.
    So, what can I use as a signal from javac that it found a problem?
    I initially tried detecting an exit code from javac that was non zero, but javac does not seem to emit such an exit coe when it objects to a file (it still returns with 0 as an exit code).
    The only remaining strategy that I can think of is to pipe javac's output to a file, and if there is any content in it then assume that it indicates an error and use that as a signal.
    This is suboptimal because it will give false signals for mere warnings, so if anyone has a better suggestion, please post

    You are right: it appears that javac does exit with an exit code of 1 if an error is detected in one of the files being compiled, at least on the windows jdk.
    To prove this, create an arbitrary java source file called HelloWorld.java, and create a msdos .bat file in the same directory that looks like
    @echo on
    javac  -Xlint:deprecation  HelloWorld.java
    :handleError
    @if not errorlevel 1 goto finalActions
    @echo ERROR DETECTED: compile.bat will TERMINATE PREMATURELY
    :finalActions
    @echo compile.bat now terminatedBy playing around with what you put in the source file (totally clean code, stuff that should compile but issue a warning, and garbage that should not compile) as well as with the exit code value detected by the .bat file, for instance trying
    @if not errorlevel 2 goto finalActions(see http://www.robvanderwoude.com/errorlevel.html if you need some documentation on error codes in dos bat files), I have determined the following as javac's behavior on windows:
    If code is pristine, exit code = 0.
    If code causes javac to emit a warning but is compilable, exit code = 0.
    If code cannot be compiled, exit code = 1.

  • Intermittent : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.

    I have developed a batch harness whereby all scheduled tasks (W2012) invoke a common powershell script that acts as a wrapper to all our housekeeping jobs.
    The first step in the wrapper is to create a Transcript file using following code
    if ($Host.name -ne "Windows PowerShell ISE Host") # Transcript does not work within ISE
    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    $path = "c:\corp\$timestamp" + "_$pid.txt"
    Start-Transcript -path $path -append
    As expected the folder contains files with timestamp & pid in name
    08/08/2013  11:00 AM            14,388 2013-08-08-11-00-01.158_1620.txt
    08/08/2013  11:00 AM            12,506 2013-08-08-11-00-01.485_936.txt
    08/08/2013  11:00 AM            12,994 2013-08-08-11-00-01.735_9328.txt
    08/08/2013  11:00 AM            12,024 2013-08-08-11-00-01.766_8624.txt
    08/08/2013  11:00 AM            13,902 2013-08-08-11-00-01.860_1756.txt
    08/08/2013  11:01 AM            15,142 2013-08-08-11-01-31.392_10120.txt
    08/08/2013  05:00 AM            14,982 _1692.txt
    However note the last file, it has a zero length date time value in the name
    The error recorded by PowerShell is
    get-date : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\Corp\Powershell\DMPRun-ScheduledTask.ps1:171 char:18
    +    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    +                  ~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (get-date:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    IE get-date has failed and returned a zero length field as the timestamp
    Can anyone think of a good reason why get-date would fail intermittently?
    Do I have to code defensively for base Powershell functions?

    I implemented David's suggestion and now I intermittently get
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_08_55_02.ps1:15 char:1
    + import-module Microsoft.Powershell.Utility
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand
    I added a trap chain (My Powershell skills do not yet include recursive trap coding, any suggestions welcome)
    trap {
        trap {
            "Trap1"
            "Exception: " + $_
            "Error: " + $Error[0]
            "Message: " + $_.Exception.Message
            "InnerException: " + $_.Exception.InnerException
            "StackTrace: " + $_.Exception.StackTrace
            "FailedItem: " + $_.Exception.ItemName
            import-module Microsoft.Powershell.Management
            import-module Microsoft.Powershell.Security
            import-module Microsoft.Powershell.Utility
        "Trap2"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        import-module Microsoft.Powershell.Management
        import-module Microsoft.Powershell.Security
        import-module Microsoft.Powershell.Utility
    import-module Microsoft.Powershell.Management
    import-module Microsoft.Powershell.Security
    import-module Microsoft.Powershell.Utility
    trap {
        "Trap3"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        exit 1
    get-date
    Now I intermittently get ..
    Trap2
    Exception: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Error: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Message: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    InnerException:
    StackTrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
       at System.Management.Automation.AnalysisCache.CacheExportedCommands(PSModuleInfo module, Boolean force, ExecutionContext context)
       at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingModulePath(PSModuleInfo parentModule, Boolean found, IEnumerable`1 modulePath, String name, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags,
    PSModuleInfo& module)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
       at System.Management.Automation.CommandProcessor.ProcessRecord()
    FailedItem:
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_09_19_52.ps1:26 char:1
    + import-module Microsoft.Powershell.Security
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand

  • How can I run a SQL script file...

    How can I run a SQL script file from a location on my computer without providing the whole path?
    Is there some way I can set a "Working folder" in SQL Plus??
    Thanks!
    Tom

    You can create an environment variable called "SQLPATH" which is a list of directories that SQL*Plus will search for your .SQL
    scripts.
    I would like to use another directory than the oracle/bin...
    How can I do this ??
    Hello,
    U can do this by this way:
    Save odm_script.sql file to the default Oracle
    directory i.e. Oracle-Home/bin and Run following command
    through SQL Plus.
    SQL>@Script_Name
    I hope this will resolve ur problem.
    Regards,
    Omer Saeed Khan.

  • How can I see the current script file name in Vision Builder

    I would like to not have to remember which script file I have open. Is that displayed somewhere?

    Brian,
    I have been looking over Vision Builder 6.1, and from what I can tell, the name of the file that you are working on is not displayed on the screen, and there does not appear to be a way to get it to display there.
    This seems like a very worthwhile feature to add, and I definitely agree that it would be useful. You may want to consider filing a Product Suggestion by using the Product Suggestion Center (PSC) that is linked below:
    Product Suggestion Center
    The PSC links directly into our R&D group's suggestion database, and any suggestions entered would be reviewed by the R&D team.
    Regards,
    Jed R.
    Applications Engineer
    National Instruments

  • How to spool file to where start script file located

    I'm writing a sqlplus script, eg. runMe.sql, which is going to run in customer env, will generate some data files eg. result.csv.
    By specify location such as 'spool /certain/path/on/disk/result.csv', I can spool to any path I want. However, my concern is  below:
    1. We gets many customers and the script might be run under different location.
    2. I don't know where customer would save the script, furthermore, I don't want customer to input location manually every time.
    3. Generally, customer would run the script something like "sqlplus username/password@sid @/certain/path/on/disk/runMe.sql". They don't want to pass any parameter at run time.
    4. I wanna spool file to "/certain/path/on/disk" automatically, as a result, result.csv file would appear under same path with runMe.sql.
    5. I tried "spool ./result.csv" but it navigate to where sqlplus session is running.
    6. Also tried &0 etc, but make no sense.
    Can anyone tell me how to obtain start running script file path in sqlplus script(runMe.sql) ? Just like access command parameters under Linux.
    $0 is the name of the command
    $1 first parameter
    $2 second parameter
    $3 third parameter etc. etc
    $# total number of parameters
    $@ all the parameters will be listed
    Thanks in advance.

    Are you looking for SQLPATH ?
    A good and clear example by Paul @ https://forums.oracle.com/message/3727891
    In this way your customer has to set one environment variable SQLPATH=/location/of/script/file/where/they/put/your/runMe.sql and just say :
    spool %sqlpath%\result.csv
    in your runMe.sql.  So, runMe.sql and result.csv will be on SQLPATH location.
    Regards
    Girish Sharma

  • Trying to install iTunes 8.0, can not find script file error

    I recently tried to upgrade Win XP for iTunes 8.0, and got the following error msg:
    can not find script file “C:\program files\uninstall scripts\quicksilver player 7.4\install.wsf”
    HELP!
    Tony

    Hey Tony, you don't happen to work for a large aerospace company, do you? My guess is that you do, because I work at the same place, and the problem is with our company's distribution of quicktime. email me off list and I'll tell you how to fix it.
    bralston at mac dot com

  • When user click on Submit in the salesquote then this submit action needs to be captured in the BeforeSave script file

    Hi Expert,
    Explanation:
    In the sales quote there is a Submit in the Action Menu, so when a user click on the submit button then sales quote approval process triggers and
    sales quote saved with Approval status as "In Approval" .
    Requirement: Each time user click on the submit of sales quote then we have to record this action and update our BO for further calculation.
    Issue: All BO elements in the ActionValidation-Submit script file are accessible but they are read only so can not be modified.
              So when you click on the Submit then immediately after submit action event beforesave gets trigger, so we build logic here but issue is that we           are not  able to segerate this save even, I mean which SAVE is coming from the EXPLICIT save button on the UI or which save being triggered           from Submit Action.
    Resolution tried: We found only one script for the submit action ActionValidation-Submit script file so we implemented this script but here all BO                          elements are read only, we can not modify those elements.
                             Even we are not able to return any variable on the validation submit script. so only we can return true/false that says validation is                          success or not.
    My Question : How to capture the information in the event before save when user click on the submit on the sales quote.
                             So other than valiation script file is there any other appraoch by which I can acheive this. even in the global variable "this"  I also dont                          find any varaible that is setting as true/false that refers to action triggers on the sales quote.
    Thanks
    Asaad

    Thanks Meghana.. Appreciate your input.
    We are doing this but the issue we are encountering is after the submit if other user changes sales quote and click on the SAVE button then we dont want this save from SAVE button on UI, so always whenever user click on the submit from action menu in the sale quote then we need to capture user information at the submit click.
    Thanks
    Asaad

  • How can I order PL/SQL functions in "Called" a "Caller" order in function script file

    Does anybody know how to create PL/SQL function script file
    in "called" and "caller" (parent/child) order.
    Thanks
    Soheil

    Does anybody know how to create PL/SQL function script file
    in "called" and "caller" (parent/child) order.
    Thanks
    Soheil

  • In some downloads I get an error message as js doesn't work: a script on this page may be busy, or it may have stopped responding, script file is: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsExtensionManager.js:623

    This is the entire message I get, but if click "stop" or "continue" nothing is fixed and the message is repeating forever...
    A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
    Script:
    file:///C:/Program%20Files/Mozilla%20Firefox/components/nsExtensionManager.js:623
    How this can be fixed
    regards
    Michey

    I encountered this issue with Win 7 but fixed it by doing the following: Open up AVG and then click on Tools / Advanced settings. On the bottom of the list should be AVG Security Toolbar, click on it. There should be an option to Repair the toolbar.

Maybe you are looking for