Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. EBGreen

    Merge CSV contents

    This is untested, but something along these lines should work: $dataOne = Import-CSV C:\Path\To\File1.csv $dataTwo = Import-CSV C:\Path\To\File2.csv foreach ($row in $dataOne){ $row.Field2 = $($dataTwo | Where-Object{$_.FieldOne -eq $row.FieldOne}).FieldTwo } $dataOne | Export-Csv...
  2. EBGreen

    Loop though all roots

    Is this supposed to be xml? Multiple roots are not valid for xml are they? "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
  3. EBGreen

    Importing a CSV into Excel with formulas

    Got it. Just me forgetting about CSV double quote interpolation. Just needed to double up my double quotes. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" -...
  4. EBGreen

    Importing a CSV into Excel with formulas

    Ok, so I'm actually doing this in Powershell, but asking the question here because I suspect that this is where I will find somjeone that knows the answer. :) It's all COM and Office automation anyway so language doesn't matter a lot in this. Here is the situation, I have a CSV...
  5. EBGreen

    Please help with command line arguments

    Then look at WScript.STDIN.ReadLine "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
  6. EBGreen

    Please help with command line arguments

    Look at the documentation for the InputBox function. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
  7. EBGreen

    How To: Convert String of Unknown Length into a Unique Value

    Well, without an upper limit on the length of the string, there is potentially an infinite size. So there is no way to uniquely represent an infinite amount of data in 15 characters or less. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational...
  8. EBGreen

    Determine Parent of Script

    In that case you may be able to navigate through the WMI Win32_Process class to use the .ParentProcess property to figure it out. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the...
  9. EBGreen

    Determine Parent of Script

    The easiest way would be for the external programs to call it with an argument that identifies the program that called it. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is...
  10. EBGreen

    Square Brackets in Switch Command

    I understood the question, and crobin1 had already provided a good answer. I was just suggesting an alternate solution to what you were trying to do. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy...
  11. EBGreen

    Square Brackets in Switch Command

    Just as a quick example, if you wanted to 0 pad a number out to 2 digits: $a = 5 "{0:0#}" -f $a "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
  12. EBGreen

    Square Brackets in Switch Command

    Just out of curiosity, are you trying to write code to zero pad or some other way format strings? If so, there are probably existing commands to do that for you. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good...
  13. EBGreen

    Displaying a variable alongside a character

    $($a)0" will work. I'm not sure that I understand your second question. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
  14. EBGreen

    %comspec%

    you have an extra " objShell.Run("%COMSPEC% /c Echo Y| setspn.exe -A http/" & objWebsite & " " & objServer", 1, True) "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the...
  15. EBGreen

    User Defined Types - assigning at group level

    You find this behavior strange? I don't know of any language that behaves in any other fashion. There is no implied order in a Type definition. So there is no way to make the engine understand that Field1 is the first 30 characters. Or is Field2 the first 6? Maybe Field3 is 4 characters starting...
  16. EBGreen

    How to create a new text file per stored procedure

    Let's try to be a little more explicit and see if that helps. See what happens with this: foreach ($folder in Get-ChildItem) { foreach($proc in Get-ChildItem) { $procName = $proc.name $fileName = "C:\$procname.txt" $proc.script() | Out-File $fileName } } "... isn't sanity really...
  17. EBGreen

    How to create a new text file per stored procedure

    I do not have SQL Server installed so it is hard for me to test, but do the procs have a .Name property? Are they stored as regular files? Do they have a .Script() method? "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you...
  18. EBGreen

    How to create a new text file per stored procedure

    If that works then yes, that is exactly what I meant. If not, then clearly I meant something else. :) To be honest with you I'm not sure what you are trying to do. Dir would create a collection of objects representing all the files and folders in the current working directory. You are looping...
  19. EBGreen

    How to create a new text file per stored procedure

    I think you need to move your Out-File inside the preceding loop. "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
  20. EBGreen

    How to create a new text file per stored procedure

    What about "C:\$name.txt" "... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick

Part and Inventory Search

Back
Top