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 biv343 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: *

  • Users: Tester_V
  • Content: Threads
  • Order by date
  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

    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.
  3. 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...
  4. 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...
  5. 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...
  6. Tester_V

    Print 4 lines before and after a "match" 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...
  7. 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.
  8. Tester_V

    Need to find two lines, Line1 and the last of a Line2 and print lines in pairs.

    Trying to pull out paired lines, LINE 1 and LINE 2 from a file for farther processing. The file goes like this: Some lines LINE 1 Some lines Some lines LINE 2 LINE 2 LINE 2 Some lines Some lines Some lines LINE 1 Some lines LINE 2 And so on. I’d like to print: LINE 1 LINE 2 (preferably last...
  9. Tester_V

    Print produces an error if placed after forth 'IF" block

    Hi, I have a problem with printing. If I place a print statement after the forth 'IF' statement I have an error (see below) If I place a print statement after the third 'IF' statement - no errors Here is the error: print ("All Lines -->> ", str_t, endt_p, rnt_p, prg_np, '\n') NameError...
  10. Tester_V

    Find all files in a directory and process only ones that have a specific line, skip if does not

    Need help, I’m new to python, I wrote a script that should find all files in a directory and process only ones that have a specific line and skip the ones that do not have the line. The specific line is ‘," Run Time’ it fails to process ONLY files I need, it processes all files. All Lines to...
  11. Tester_V

    need to read sub directories only

    Hi, I'm trying to read subdirectories only (with the path) but the code I found also prints the top dir+path that is "C:\\01' I probably could write the output to a file and then would remove the first line from it but it is kind of unnecessary work. Thank you in advance. Here is the code...
  12. Tester_V

    cannot get read of a "new line"...

    Hi, I hope everyone is well and healthy and staying at home! And for some reason when I posted my code it removed the "tab" before some lines. Sorry about that! I tried to use <code> button and the "Superscript" and "Subscript" still the snippet lost it's "tabs'. Anyway, I have a strange...
  13. Tester_V

    Last match from a file

    Hi, need help again. I have a file and it can have one line or many lines with the words I'm trying to match Words to match: "... Lot End..." I need to capture the last line that has this occurrence. I thought I could just push all the match lines to an array and then get the last element but...
  14. Tester_V

    Need to print only the first line that has a match ...

    Hi, Need to print only the first line that has a match ... I have a line in a file : “ 2019-02-02 17:12:02.860,10552 ,Information," Test Program Name: Something else“ And the part of the line I need is - “Test Program Name: Something else” I’d like to print only first line that matched...
  15. Tester_V

    Script hangs, no errors

    I got 3 scripts. 1st script scans subnets and prints out Active and not Active IPs. 2d script opens file with Active IPs and finds corresponding Active Hosts names. 3d script opens file with the Active Hosts names and pulls out some stuff from it. When I ran each script separately, I have no...
  16. Tester_V

    Hot to call Perl script from Python

    Hi, there are a lot of snippets on how to do this, I probably tried 90% of them by now but nothing is working. I started writing in Python, I never thought such a simple thing like a calling other script would be that complicated, what a pile of crap this Python is. Any way, is anybody has a...
  17. Tester_V

    Building graph produces error &quot;Cannot open gdgraph1.png:Permission denied&quot;

    Hi, I’d like to build a graph using Perl, I know nothing about using GD module but I thought Google will help-I was wrong. I Googled bunch of examples but it seems they all producing same error “Cannot open gdgraph1.png:Permission denied”. I could use Excel but want to use Perl.My data table...
  18. Tester_V

    Need to sum all numbers in in all files (separately) in a directory

    It is my first post in the forum. Sorry if I'll do something wrong. I do not see "code" button, so I'll just paste the code here. Hi, I have number of files in a directory like this: Cell_01.txt, Cell_02.txt and so on... Each file has number in a column, something like this: 12 06 1234 45...

Part and Inventory Search

Back
Top