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 strongm 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. Jongskie M.

    Copying current file to destination

    Hi SoftwareRT, from the code below, kindly insert a code validation if the file is exist then it prints file is already existing from the destination path. === # Create the destination directory if it doesn't exist if not os.path.exists(dest_dir): os.makedirs(dest_dir)...
  2. Jongskie M.

    Copying current file to destination

    Thanks SoftwareRT
  3. Jongskie M.

    Copying current file to destination

    Dear Gents, Below code shows on how to copy the recent file from source to destination, and when I compiled it just only pops & nothing happens, kindly help and reencode. thanks. src.dest202410150039728.txt <-- this file should be copied to the destination. src.dest20241008012256.txt ========...
  4. Jongskie M.

    REXX Get last two digits of the year

    mikrom (Programmer) use substr(ystrday,3) hi mikrom, how about this format 08022024 <--DDMMYYYY
  5. Jongskie M.

    REXX Get last two digits of the year

    Hi mikrom, thank you so much.
  6. Jongskie M.

    REXX Get last two digits of the year

    Hi, I would like to display the last two digits of the year from the code below, please amend, thx ystrday = date('s',(date('b')-1,'b') CALL ZocSend "RE"||ystrday"||" ^M" RE20240208 Am expecting a result of RE240208
  7. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Thank you mikrom for your suggestion, I segregated the path code, they are now opening using os.startfile() function, but the result of the os.startfile() is only in D:\tmp0\2024 & D:\tmp1\2024, the requirements will be pointed out directly inside the newly created folder, how's that? See snip...
  8. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi, from the highlighted function below am expecting an result of U:\tmp\2024\Feb 2024\2024-02-01\ & V:\tmp\2024\Feb 2024\2024-02-01\ but the output are only pointing in U:\tmp\ and V:\tmp\ folder separately , how do you declare? print("Executing to create two folder directory namely :\n\n" +...
  9. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    am trying to reencode with print function to show the two folders, but it will display only the V:\tmp folder, & another thing the os.startfile() function should open both folder after it was been successfully created, is that possible? >>> paths = ["U:\\tmp\\", "V:\\tmp\\"] >>> for path in...
  10. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    what I mean is that, it will create a folder with different location/path, not in a subdirectory. my_path0 = "U:\\tmp\\" my_path1 = "V:\\tmp\\" U:\tmp\2024\"Feb 2024"\2024-02-01 V:\tmp\2024\"Feb 2024"\2024-02-01 regards,
  11. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, From the code below, how to create same folder name in different path. >>> from datetime import date, timedelta >>> yesterday = date.today() - timedelta(days=1) >>> current_time = yesterday.strftime('%Y\\"%b %Y\"\%Y-%m-%d') >>> print(current_time) 2024\"Feb 2024"\2024-02-01 >>>...
  12. Jongskie M.

    REXX Loop conditional statement not working

    Hi mikrom, Indeed, its ok now. Thanks.
  13. Jongskie M.

    REXX Loop conditional statement not working

    Hi mikrom, Yes the code is working so far, but the requirements doesn't met. Scenario: From the ZocRequest(Highlighted in Red) once the user pressed "Yes", the code exited instead it will loop again to login = ZocAsk("What is your name:?"), kindly add what am I missing. Thanks.
  14. Jongskie M.

    REXX Loop conditional statement not working

    Hi am neophyte here, can you check the script below on how to declare loops in the conditional statement which start from the highlighted below. Call ZocCls login = ZocAsk(" What is your name:? ") IF login = "##CANCEL##" THEN DO answer = ZocRequest(" Command Cancelled , Retry?"...
  15. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, Great thanks for this code. you help a lot. regards,
  16. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi micron, Highlighted below should automate the date everyday as a variable. import os def check_path(the_path): if os.path.isdir(the_path): print("path", the_path, "is a directory") else: print("path", the_path, "is not a directory !") [highlight #FCE94F]my_path =...
  17. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi micron, Are there any way to automate the date completely from my_path = "2024\\Jan_2024\\2024-01-11" not a string. Example : Today - 2024\Jan_2024\\2024-01-11 Tomorrow - 2024\Jan_2024\\2024-01-12 I appreciate your efforts.
  18. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, os.path.isdir(path) os.path.exists(path) how to insert/ declare that function on below code. >>> current_time = yesterday.strftime('%Y\%b_%Y\%Y-%m-%d') >>> print(current_time) 2024\Jan_2024\2024-01-11 >>> command = "mkdir {0}".format(current_time) >>> print(command) mkdir...
  19. Jongskie M.

    How to open a folder in Python command after it was been created automatically?

    Dear Gents, Below script creates a previous folder based on the date. 1. The question is how to go or open that folder automatically after it was been created. 2. How to create two folders with different drive or path based on the script below. path = "G:" "H:" current_time =...
  20. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, How to encode the if.. else statement(say "Folder Created" else Folder Already Exist! on the last subfolder creation(2024-01-11).

Part and Inventory Search

Back
Top