Automic Workload Automation

  • 1.  Append text from one text file to other

    Posted Nov 28, 2017 03:49 AM
    I have read a text file and tried to append the data to another text file using "WRITE_PROCESS" . The key word APPEND is actually not appending text rather overwriting it. Please suggest.

    P.S.: I am using trial version of Automic Workload automation in windows machine


  • 2.  Append text from one text file to other

    Posted Nov 28, 2017 09:08 AM
    Hi,

    kindly please post the content of the process tab.

    regards,
    Peter


  • 3.  Append text from one text file to other

    Posted Nov 29, 2017 12:04 AM
    Hi Peter,

    I have modified the code and able to get the desired result. however request you to check and let me know if it is fine to proceed ?

    :set &file1# = 'c:\test22.txt'
    :set &hnd1#=prep_process_file("DEMO5_WINDOWS_PS","&file1#")

    :process &hnd1#
    :   set &line1#=get_process_line(&hnd1#)
    :   SET &Append1# = WRITE_PROCESS(&hnd1#,"C:\test23.txt",DEMO5_WINDOWS_PS, LOGIN.ALL,APPEND)
    :   set &Append1# = UC_CRLF
    :endprocess

    :set &file2# = 'c:\test23.txt'
    :set &hnd2#=prep_process_file("DEMO5_WINDOWS_PS","&file2#")

    :process &hnd2#
    :   set &line2#=get_process_line(&hnd2#)
    :   print &line2# 
    :endprocess

    :   print  "File is Appended successfully"

    Thanks
    Srikanth 


  • 4.  Append text from one text file to other

    Posted Nov 29, 2017 01:36 AM
    Hi Srikanth, please try this sequence (adjust file and agent names to your environment) :set &file1# = '/tmp/file1.txt' :set &hnd1# = prep_process_file("LINUX1", "&file1#") :set &append1# = write_process(&hnd1#, "/tmp/file2.txt", "LINUX1", LOGIN.GP, APPEND) :set &file2# = '/tmp/file2.txt' :set &hnd2# = prep_process_file("LINUX1", "&file2#") :process &hnd2# :  set &line2# = get_process_line(&hnd2#) :  print &line2# :endprocess :print "File is Appended successfully" regards, Peter


  • 5.  Append text from one text file to other

    Posted Nov 29, 2017 01:39 AM
    Thank you . Let me try 


  • 6.  Append text from one text file to other

    Posted Dec 04, 2017 12:35 PM
    If appending two files is the only requirement, you can also use OS methods from within UC4. Here's some more ways to append two text files on Windows. For large files, this may have superior performance:

    type source1.txt source2.txt > target.txt
    copy source1.txt +source2.txt target.txt