I have two processes : TEXT_ANALYSIS_PROCESS
and the other one is CALL_TEXT_ANALYSIS_PROCESS
In Call_Text_Analysis i am calling Text_Analysis Process.
I have multiple files in a folder which have the Alias Name as filename and i performed WILDCARDSEARCH for.csv files and want to create new csv file with new alias Name.
I am performing analysis of the Word and count of that Number. So when next time when i perform the analysis it should be the Alias Name and renamed as Filename.
I am writing the code in Prolog section of both the Processes.
*************************
CALL_TEXT_ANALYSIS_PROCESS
*************************
Importpath = sRootPath | actYear | '\' | actFolder;
Process = 'Text_Analysis_Process';
Wildcard = '*.csv';
PriorFile = TRIM(CellGetS('xParam', 'TextAnalysis_PriorFile', Param));
#
# Search for new files in import folder
#
IF (PriorFile @<> '');
ProcessBack = ExecuteProcess(Process, 'pImportpath', Importpath, 'pFile', PriorFile);
ENDIF;
k = 1;
File = WildcardFileSearch( Importpath | Wildcard , PriorFile);
WHILE(LONG(File)>0);
ProcessBack = ExecuteProcess(Process,'pImportpath',Importpath,'pFile',File);
PriorFile = File;
# Get new file
File = WildcardFileSearch( Importpath | Wildcard, PriorFile);
# Save old file name for rename befor define next file
sOldFile = PriorFile;
k = k + 1;
END;
# Quit Process manuel to force an error message after import
IF (DataMinorErrorCount > 0);
ProcessQuit;
ENDIF;
*******************
TEXT_ANALYSIS_PROCESS
*******************
scandot=SCAN('.',pFile);
pCheck=SUBST(pFile,1,pDot-1);
vcheckname=DimensionElementPrincipalName(AnaDim,pCheck);
IF( Lower(vcheckname) @=Lower(pCheck));
sACnt=NUMBERTOSTRING(DIMSIZ(AnaDim)+1);
sALen=Long(sACnt);
sAnaElem='A_' | FILL('0',3-sALen) | sACnt;
DimensionElementInsert(AnaDim,'',sAnaElem,nType);
aElem=sAnaElem;
Else;
aElem=vcheckname;
ENDIF;
s_aliasname = ATTRS(AnaDim,aElem,'Alias');
vFileName='\\AFWIA190\Tm1Data\#Import\2017\20_TextAnalysis\';
ASCIIOutput(vFileName,s_aliasname);
DataSourceNameForServer = pImportpath | pFile;
Your would be appreciated