cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Dear Experts,

I have a scenario where PI (7.1) has to pick file from a FTP server and also IDoc data should write on File using FCC in both cases. However the incoming file (fixed lengths) will be in following format without any end-separator, so I would like to know whether the FCC will work for this requirement or not...

usually file with End-separator looks like below...

002     123     2345BBB     C

003     231     ADD2213     E

However, in my case the file comes contentiously without any End-separator...

002     123     2345BBB     C003     231     ADD2213     E

In the same way, we have to write the file in another interface (IDoc to File) without any End-separator using Append functionality...

Could you please check and give me some idea on this requirement?

Thanks-
Rams

0 Likes
View Entire Topic
gagandeep_batra
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi rams,

As there is no end separator you  can read the whole file in single line and use UDF in mapping to split it.

Regards

GB

Former Member
0 Likes

Dear GB,

Shall i request for any sample code to read the whole file in a single line and split it using UDF.

It would be very thankful for your kind help.

Regards,
Rams

former_member191435
Contributor
0 Likes

Hi Rams,

Please find below thread...

take one string as a source and create your target structure as it is... and use code of Mark used in below thread.

Thanks,

Sreenivas

Former Member
0 Likes

Thanks Sreenivas,

I have gone through the link, however the discussion was on splitting the string "Based on some symbol". But in my case it is on fixed lengths, how can i acheive this solution?

Regards

Rams

Former Member
0 Likes

read each line into separate string.. follow Greg's suggestion in the below thread for FCC.

For splitting the string based on fixed length go through below discussion which has lot of suggestions.

splitting string in java into fixed length chunks - Stack Overflow