Page 1 of 1

Specify File Pattern for Sequential files

Posted: Sat Jul 04, 2009 3:37 am
by lazydev
I have three files named fileA.txt,FileB.txt,FileC.txt

I want to read all the files at a time and process them into the other table.

In The Properties Tab

Under Source :-

FILEPATTERN :- C:\DXFILES\File?.txt
READMETHOD :- filePattern .

But i am not able to read all the three files .

What would be the expresssion to read all the files .I think it's ? or anyother .

Re: Specify File Pattren for Sequential files

Posted: Sat Jul 04, 2009 5:05 am
by mithun.mg
lazydev wrote:I have three files named fileA.txt,FileB.txt,FileC.txt

I want to read all the files at a time and process them into the other table.

In The Properties Tab

Under Source :-

FILEPATTREN :- C:\DXFILES\File?.txt
READMETHOD :- filePattren .

But i am not able to read all the three files .

What would be the expresssion to read all the files .I think it's ? or anyother .

Hi Lazydev,

Use * instead of the "?" then you will be able to read the files using the file pattern in sequential file stage.

FILEPATTREN :- C:\DXFILES\File*.txt

Posted: Sat Jul 04, 2009 7:07 am
by chulett
Technically that "?" should work as it is a wild-card match for any single character which you have in your 1,2,3 differentiator. It works fine from DOS but perhaps the stage doesn't allow or 'understand' it.

As noted, you can fall back on the 'splat' or asterisk to mean 'any number of characters' from that point to the dot. So not only would it match

FileA.txt
FileB.txt
FileC.txt


It will also match FileAAA.txt which your first choice would not, hopefully that's not a problem.

Posted: Sat Jul 04, 2009 1:53 pm
by Sainath.Srinivasan
Maybe you can explain what you do mean by
But i am not able to read all the three files .

Posted: Sat Jul 04, 2009 5:44 pm
by nagarjuna
Give the name of your three files

Posted: Thu Jul 09, 2009 11:09 am
by lshort
I have the same issue:

Can read multi file if specifed seperately use -File option.

File = D:\IBM\InformationServer\Server\SeqFiles\NameAmountDate2.csv
File = D:\IBM\InformationServer\Server\SeqFiles\NameAmountDate3.csv
Read Method = Specific Files

-File Pattern option does not function with (?) nor (*) as referenced in documentation.

Example:

FilePattern = D:\IBM\InformationServer\Server\SeqFiles\NameAmountDate?.csv
Read Method = File Pattern

Windows 2003 Server
version 8.1

Posted: Thu Jul 09, 2009 2:42 pm
by ddevdutt
In fact as Craig specified, both "*" (asterisk) and "?" work just fine. It depends on what your requirement is.

1. "?" - used to replace a single character.

For Example:
File1 = /TestPath/File1.txt
File2 = /TestPath/File2.txt

These files can be read as follows:
File Pattern: /TestPath/File?.txt
OR
File Pattern: /TestPath/File*.txt

2. "*" - used to replace any number of characters.

For Example:
File1 = /TestPath/Yahoo_File.txt
File2 = /TestPath/Google_File.txt

The above files can be read as follows:
File Pattern: /TestPath/*File.txt

Posted: Thu Jul 09, 2009 2:48 pm
by ddevdutt
I just happened to notice that the two people who have problems reading the files using File Pattern are both on Windows. Not sure if it has anything to do with that.

I have no problems reading those files, but I'm using V8.1 on Linux.

Posted: Thu Jul 09, 2009 3:28 pm
by chulett
I'd noticed the same thing - this somehow seems to be a Windows issue. :?

Posted: Thu Jul 16, 2009 7:52 pm
by siauchun84
I am a windows user and I have no issue in using the pattern when the input files was in fixed width and all the column type in the files defination have been set it to char and no nullable.
Those who have issue on it, may I know the input files setting of it?
Have you tried changed the "\" to "/" for the file path?