cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

csv2xml utility call in a class it executes but not exit and not executes the remaining statements of a program

vuchekar
9-Granite

csv2xml utility call in a class it executes but not exit and not executes the remaining statements of a program

Hi All,

I make a Simple programe to which call the OOTB csv2xml functionality..

As you can see below, very simple program, it works well.. It creates xml files from csv files which are present at <WT_Home>\src\loadfiles\

but one issue is..

the csv2xml ootb utility does not exit and my remaining statements after this is not executing..

i want to executes the remaining staements after the execution of csv2xml utility..

ho i can do this..

Please help me out..

package ext.util;

public class NewCsv2Xml {

public static void main(String[] args) throws Exception{

System.out.println("Calling OOTB CSV2XML Utility");

NewCsvXML.class.desiredAssertionStatus();

wt.load.util.CSV2XML.main(args);

System.out.println("Done....");

}

}

/// out put of this programs..

/*

Calling OOTB CSV2XML Utility

Map file: C:\ptc\Windchill_10.1\Windchill\loadFiles\csvmapfile.txt

Root directory: C:\ptc\Windchill_10.1\Windchill\src\loadFiles

Input: C:\ptc\Windchill_10.1\Windchill\src\loadFiles If this is a directory, all csv files will be processed.

Expected encoding of source file(s): default

Output: C:\ptc\Windchill_10.1\Windchill\src\loadFiles

delimiter: ,

Preserve Space: No

Processing file: C:\ptc\Windchill_10.1\Windchill\src\LoadFiles\WTDocument.csv

Reading source csv file with encoding Cp1252

Processing file: C:\ptc\Windchill_10.1\Windchill\src\LoadFiles\WTPart.csv

Reading source csv file with encoding Cp1252

*/

1 REPLY 1

CSV2XML.main(String[]) calls System.exit(0) so your program will not go any further.

Perhaps you could call CSV2XML as an external program?

E.g.

String command = "java -classpath <somepath> wt.load.util.CSV2XML <someargs>";

Runtime.getRuntime().exec(command);

// and so on...

I haven't tried it and there would be some details to work out.

Top Tags