I'm still not clear if (1) these destination paths are accessible from the same server as the file, (2) what operating system you're dealing with, and (3) whether this file with the 11th column contains multiple destinations or just one.
For starters, I'll assume you've established UC4 script variables for your source file (&FILE#) and the destination path you've read from the 11th column (&DESTINATION_PATH#). Let me know if that's where you're struggling. Please share your script code in that case.
If you're copying the file to another path on the same server, then just add a job that does "cp &FILE# &DESTINATION_PATH#".
If you're trying to transfer the file to a different agent, then you'll need to add a file transfer job and add code on the Process tab to do a ":put_att FT_DST_FILE="&DESTINATION_PATH#/&FILE#". (Make sure this file transfer job is configured to generate at runtime.)
If you're trying to copy the file to multiple destination paths -- one for each row of this file with the destination in the 11th column -- then I would advocate using your script to do a ACTIVATE_UC_OBJECT, passing your &FILE# and &DESTINATION_PATH# variables, to a separate workflow (or at least job or file transfer job) to copy the file.
Original Message:
Sent: Nov 28, 2024 01:19 AM
From: ALSHAYA AUTOMIC
Subject: Script to read the file
Hi Daryl,
I need to open the file, check for the 11th column where the location will be present. In regards to that i need to send the file for that location.
I have created a script to check for the 11th column, please let me know how to send the file for the particular location.
Original Message:
Sent: Nov 22, 2024 09:21 AM
From: Daryl Brown
Subject: Script to read the file
I'm still not completely following here.
Is column 11 the field that lists the destination for the file?
If the file has, say, 10 rows, does that mean you're trying to copy this one file to 10 different locations?
Are these different locations just different paths accessible from the OS agent (not the SQL agent), or are we talking about doing File Transfers (agent-to-agent) here?
The PREP_PROCESS_FILE function should help you with parsing the file and reading the 11th field, but I'm fuzzy on what's supposed to happen from that point. You could either use your loop to activate a separate job/workflow to do the file copy (using ACTIVATE_UC_OBJECT) to each individual destination, or perhaps just invoke a copy/cp command (again, not sure what OS we're dealing with here) to copy the file.
Original Message:
Sent: Nov 22, 2024 04:19 AM
From: Shravya Devadiga
Subject: Script to read the file
Hi Daryl,
We have the requirement to transfer the file from source to target and then read the 11th column of the file (every line), as per the Locations mentioned we need to send the file to the similar locations(targets).
The file data is separated by pipeline.
To insert the data we are using SQL agent in automic.
Let me know if anything is needed.
Original Message:
Sent: Nov 21, 2024 10:08 AM
From: Daryl Brown
Subject: Script to read the file
You're missing some of pertinent details here...
- What OS (agent) are we working with here?
- How are the columns delimited in this file? (e.g., commas? semicolons? pipes? tabs?) Or did you mean we're supposed to read the 11th character of each line?
I don't understand what the ask is with your third point (transferring files to different target paths). What is the challenge here?
Original Message:
Sent: Nov 21, 2024 06:07 AM
From: Shravya Devadiga
Subject: Script to read the file
Hi Team,
I need a script for the below cases,
1. Open the file
2.Read the 11th column
3.In regard to filenames, i need to tranfer the file to different target paths.
Quick help would be appreciated.
Thanks and regards,
Shravya