#include <ae/ae.h>
#include <ae/datasettype.h>
#include <ae/nxsm.h>
#include <custom.h>
#include <dataset.h>
#include <ecm/ecm.h>
#include <epm/epm.h>
#include <folder.h>
#include <form/form.h>
#include <ict_userservice.h>
#include <item_errors.h>
#include <itk/mem.h>
#include <property/prop.h>
#include <property/prop_errors.h>
#include <property/prop_msg.h>
#include <stdarg.h>
#include <string.h>
#include <tc.h>
#include <tc/emh.h>
#include <tc/emh_const.h>
#include <tc/tc.h>
#include <tccore/aom.h>
#include <tccore/aom_prop.h>
#include <tccore/custom.h>
#include <tccore/item.h>
#include <tccore/item_errors.h>
#include <tccore/method.h>
#include <tccore/tctype.h>
#include <tccore/workspaceobject.h>
#include <tcinit/tcinit.h>
#include <time.h>
int iNumErrs = 0;
register int i = 0;
return ITK_ok;
int ReturnCode;
if (ReturnCode != ITK_ok)
{
return (ReturnCode);
return (ReturnCode);
int i,j=0;
for(i=0;str[i]!='\0';i++)
ptr[j++]=str[i];
ptr[j]='\0';
str=ptr;
free(ptr);
return 0;
{
char *file1 = NULL;
FILE *fp1;
char **list;
int ifail;
int backVal = 0;
int count= 0;
IMF_file_t fileDescriptor ;
tag_t default_tool_tag;
AE_reference_type_t reference_type;
IMF_file_t filedescriptor;
//ITK_initialize_text_services : Initializes the Teamcenter text services. This is necessary to get the
correct
//error strings when you use EMH_get_error_string, or by certain other Teamcenter functions that
make use of text services, like
//forms
new_name1=(char*)MEM_alloc(sizeof(char)*120);
new_name2=(char*)MEM_alloc(sizeof(char)*120);
LineRead1=malloc(30000);
file1=ITK_ask_cli_argument("-i=");
fp1=fopen(file1,"r");
AE_find_datasettype ("MSExcel",&datasettype_tag);
AE_ask_datasettype_def_tool(datasettype_tag,&default_tool_tag);
if(fp1==NULL)
else
while(fgets(mystring1,200000,fp1) !=NULL)
if(mystring1)
{
strcpy(LineRead1,mystring1);
RqmtID=strtok(LineRead1,"\n");
strcpy(new_name1,RqmtID);
backVal = trim(new_name1);
strcpy(new_name2,new_name1);
strcat(new_name2,".xls");
CALLAPI(AE_find_all_datasets(new_name1,&n_items,&item_tags));
if (n_items >= 1)
else
CALLAPI(AE_set_dataset_format(tDataset,"BINARY_REF"));
//Set the tool(tool with which this dataset to be open) for Specified dataset
CALLAPI(AE_set_dataset_tool(tDataset,default_tool_tag));
CALLAPI(AE_ask_datasettype_refs(datasettype_tag,&count,&list));
if ( IMF_import_file ("/home/req83/Deliverable.xls",NULL,SS_BINARY,&imannewFileTag,&filedescriptor)
!=ITK_ok ) PrintErrorStack();
save_object(imannewFileTag);
if (AE_add_dataset_named_ref(tDataset,list[0],SS_BINARY,imannewFileTag) !=ITK_ok )
PrintErrorStack();
save_object(tDataset);
printf("\nDataset is created\n");fflush(stdout);
}
fclose (fp1);
return ( ITK_ok );