Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Determine FileName Prefix

Hi Guys,

I try to determine the prefix set on the file name.

On the first hand, i have a list of prefix available and already loaded (table FilesPrefixs)

On the other hand, i have a folder containing a list of files as Input.

The goal is to determine what is the correct prefix to execute the correct SUB.

What i have done at this time :

DeterminePrefixTemp:

LOAD FileNamePrefix

RESIDENT FilesPrefixs

WHERE SubStringCount(SubField($(vFileName),'-',1), FileNamePrefix) > 0;

For example :

> vFileName contain ABCD1243-20120101-195312

> FileNamePrefix is supposed to contain : ABCD

The result is an error : Unknown Field : ABCD

I don't understand where is my problem.

Do you have an idea on what i'm doing wrong.

Thanks a lot for your help.

1 Solution

Accepted Solutions
MayilVahanan

HI

SubStringCount(SubField('$(vFileName)','-',1), FileNamePrefix)

I think error you occur, field not found <ABCD>..

if not, please check the data in fieldnameprefix

That helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
Gysbert_Wassenaar

Your table FilesPrefixs does not have a field named ABCD. So LOAD ABCD ....etc fails.


talk is cheap, supply exceeds demand
MayilVahanan

HI

SubStringCount(SubField('$(vFileName)','-',1), FileNamePrefix)

I think error you occur, field not found <ABCD>..

if not, please check the data in fieldnameprefix

That helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

The field i'm loading from FilesPrefixs is : FileNamePrefix not ABCD

and i want to identify the row preseting the value ABCD.

Not applicable
Author

Hi Mayil,

you're right, this was the problem.

Thanks a lot.