File without delimiter

One Star

File without delimiter

Hi,
I'm trying to read a file with no delimiter but only fixed length fields. I tried to use tFileInputDelimited with "" or nothing as a row separator but it doesn't work.
How can I do that ?
Thank you
One Star

Re: File without delimiter

try with tFileInputPositionnal
One Star

Re: File without delimiter

Sorry i wrote tFileInputDelimited but is tFileInputPositional that I used of course
One Star

Re: File without delimiter

Hello ebremond,
can you give us a example?
I started a small test (2.3.0, java, windows):
I tried the following:
aaaa1bbbb1
c1ddddddd1
eeeeeeeee1
--
aaaa2bbbb2
c2ddddddd2
eeeeeeeee2
--
With the following Pattern: "5,5,2,2,8,2,10" and Row Seperator: "--"
Result:
.---------+----------+----------+----------+----------.
| tLogRow_1 |
|=--------+----------+----------+----------+---------=|
|newColumn|newColumn1|newColumn3|newColumn4|newColumn6|
|=--------+----------+----------+----------+---------=|
|aaaa1 |bbbb1 |c1 |ddddddd1 |eeeeeeeee1|
|aaa |a2bbb | |c2dddddd |eeeeeeee |
| | | | | |
'---------+----------+----------+----------+----------'

I learned myself the following: If you use anything else than "\n" you have to handle existing linebreaks (in Windows/DOS 2 Bytes). In my case defining two additional datablocks each 2 bytes large.
If I use "" as row seperator it work the same to. But with the data above (-- removed) I get the following problem:
I've starting with the second datablock one more linebreak to handle. And actual no solution for this...
And the last one:
If I remove all linebreaks it works fine.
Bye
Volker
One Star

Re: File without delimiter

I example would be :
Input File :
aaaaa1bbb1ccccccc1ddddddddd1aaaaa2bbb2ccccccc2ddddddddd2aaaaa3bbb3ccccccc3ddddddddd3
with pattern "6,4,8,10" to obtain for example in a csv file :
aaaaa1;bbb1;ccccccc1;ddddddddd1;
aaaaa2;bbb2;ccccccc2;ddddddddd2;
aaaaa3;bbb3;ccccccc3;ddddddddd3;
I tried with row separator = "" and it worked. I think the types I defined for the columns was wrong first time and induced my misunderstanding.
Thank you.
Bye