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 Mike Lewis 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. Tester_V

    timezone conversion

    Hi, does anyone understand the timezone conversions? I found I cannot see the "real" timestamps of the files in a share in Asia when I mount it to my server in Pacific NW. I thought I can do the following and it will give me the results I want but it did not. time_today_KL =...
  2. Tester_V

    Hi, I need to pass a User name and

    Yes, 'PowerShell Remoting enabled' - is enabled. Thank you.
  3. Tester_V

    Hi, I need to pass a User name and

    Hi, thank you for helping me with this! I need to accomplish two things. 1. get the Process list from a remote computer 2. start a script on a remote host I tested both one-liners, I ran it from my laptop to get the Process list and to execute a Python script on my desktop. Of course, both PCs...
  4. Tester_V

    Hi, I need to pass a User name and

    Hi, I need to pass a User name and a Pass to the PS script. I tried to find it online but could not. Ant idea how to do this? Invoke-Command -Computer DESK-2.domain.somecorp.com -Scriptblock {C:\Python39\python.exe 'C:\temp\DT_Col\HN.py'} thank you.
  5. Tester_V

    Get process ID from a remote computer

    I really do not know anything about the PS, I found this code on the Microsoft website. Just FYI, the target PC is running W10 Enterprise
  6. Tester_V

    Get process ID from a remote computer

    Here is the error: Get-Process : Couldn't connect to remote machine. At line:1 char:2 + Get-Process powershell -ComputerName desk2 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Process], InvalidOperationException I can ping the...
  7. Tester_V

    Get process ID from a remote computer

    Greetings! I have never used PS. I'm trying to get PS script to get processes running on a remote computer. Microsoft documents have this example "Get-Process -Name PowerShell -ComputerName localhost, Server01, Server02" But like everything at Microsoft, it is confusing and not clear. I tried...
  8. Tester_V

    Print 4 lines before and after a "match" found

    And the same story with this snippet. It prints what I need but I need to print it to aa different file. Have no idea how to print the lines to a file. index = 0 with open(myfile, "r") as f: for line in f: index += 1 if "FIND" in line: f.seek(0)...
  9. Tester_V

    Print 4 lines before and after a "match" found

    To "feherke". I'm trying to understand your code but it is too much for me for now. Why this If block is the last block in the script? if "FIND" in line: And this part of the script is totally confusing if (len(before) < 5): before.append(line) else...
  10. Tester_V

    Appending some rows in a .csv file from another .csv file

    Thank you all! Great snippets! I'm ok now.
  11. Tester_V

    Appending some rows in a .csv file from another .csv file

    OK. I could not make csv modules to work and I decided to go the long way. I wanted to open both files, find matching lines, and append the last element of one file to the end of the second file. For some reason, the code stops after the first match. Here is a code: import os import re...
  12. Tester_V

    Appending some rows in a .csv file from another .csv file

    Hi, I need to append some of the rows in a .csv file from another file. I have never done it before, I found some snippets online to do that. I thought I should do it line by line. First, I wanted to find lines for appending in a File1, then find the same in a File2 and use the last element of...
  13. Tester_V

    Find specific subdirs, open files and find specific lines that are missing from a file

    To mikrom, Great post! I'm still at the beginning of my "Python road" and I need to learn a lot. I did not even try to use dictionary or functions..... I'm sure there are some other ways how to do this I just do not see any and I appreciate your help!
  14. Tester_V

    Find specific subdirs, open files and find specific lines that are missing from a file

    Hi, I have a directory with bunch of subdirectories each subdir has a one file only, I need to process files only form the subdirectories that have letter “H” in a name. Each file will contain lines with the words "CELL-1", "CELL-2" up to "CELL-12 "- I’m interested in those lines . I'd like to...
  15. Tester_V

    Print 4 lines before and after a &quot;match&quot; found

    That is awesome! Now I need to understand it. Thank you for your coaching!
  16. Tester_V

    Print 4 lines before and after a &quot;match&quot; found

    Greeting! I’m trying to print 4 lines before and after a “match” found in a line. I do not understand how to do it with my current knowledge of Python Confused but I found 2 snippets, One finds lines Before the match and one After the match. Need help putting them together. Thank you. from...
  17. Tester_V

    Need to add HH:MM:SS:MS

    Thank you!
  18. Tester_V

    Need to add HH:MM:SS:MS

    Hi, Does anybody knows how to add times in Python? Need to add HH:MM:SS:MS The file goes like this: 5/1/2020 2:40:31 PM, 5/1/2020 2:43:11 PM, 00:02:40.5449136, 5/1/2020 2:45:26 PM, 5/1/2020 2:48:17 PM, 00:02:50.8250927, the third column is a timduration, need to sum it up. Thank you.

Part and Inventory Search

Back
Top