on 09-15-2008 5:09 AM
Can some one give me an example for OS command in file adapter.
i need exampled.
Hii Harsha..
If you need or want to execute specific OS command via FTP you can use this guide:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/rzaiq/rzaiqrcmd.htm
But the support of OS command depends from with FTP server you are connecting to.
You need to write Shell script for this kind of requirement,
There is a split command available
SPLIT -- Split a file into fixed-size pieces
Refer below pdf for reference commands
http://www.maths.dundee.ac.uk/software/OSXcommands.pdf
Please see the below links
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try with this commmand
with your receiver adapter where your file name comes with counter
and prefix as e.g. "abc".
this command will extract the filename starting only with abc and you can then move that file into any folder you want or simple you can generate a file name in name.txt.
save this command as bat file and give path in your in NFS file adapter and after processing.
@echo off
for /F %%a in ('dir /b abc.') do set FileName=%%~nxa
echo %FileName%>name.txt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Generally these functions are used to operate before & after adapter process. i.e most of the cases before adapter process need to merge two files into one file, in this scenario we will choose process before command. After process target file need to move to some other folder that time we will choose process after command.
Most of the time OS commands will use when adapter function will work either before or after.
Find below link for more help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Try doing it using UDF's.
smthng like this .
import java.io.File;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class RunSystemCommand {
public static void main(String args[]) {
String s = null;
// system command to run
String cmd = "copy a.txt b.txt";
// set the working directory for the OS command processor
File workDir = new File("c:
temp");
try {
Process p = Runtime.getRuntime().exec(cmd, null, workDir);
int i = p.waitFor();
if (i == 0){
BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
// read the output from the command
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
}
}
else {
BufferedReader stdErr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
// read the output from the command
while ((s = stdErr.readLine()) != null) {
System.out.println(s);
}
}
}
catch (Exception e) {
System.out.println(e);
}
}
}
Regards.
Siddhesh Naik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please search the blogs section of SDN with the string "OS command"
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.