cancel
Showing results for 
Search instead for 
Did you mean: 

Problem FTP-Sender: File-Structure limited by 80 char. and complicate struc

Former Member
0 Kudos

Hello,

I have a problem concerning reading data via FTP. We have following structure where the limitation per row is by 80 characters.

The first row start with # and has no delimiters.

The 2nd to 5th row have fields with delimiter ";". The data in between the delimiter are with identifiers, that means "001GIE" for example, so we can manage to read the right field and map it properly because of the identifier "001".

As you can see in the example below all fields have identifiers but the problem is that some data is obligatory, so no must.

So how we can manage to read this file via FTP and map it to the right fields.

My idea is to read all data as dummy and identify the single data by identifier. Therefore we need a dummy structure for line starting with # and structure for each row following. after getting the strings read we can identify the single data by identifier.

Or is there a much more easier way?!

#HHC BHCU3098960 GIE 010 090428142411GEU 090428142411

001GIE;002090428;0031341;005D ;007TCT ;010BHCU3098960 ;01120;01286;013SCI01;019

2N ;02122G1;027E;0300;033V;03524171;03621986;03702185;03915464 ;04015464

;045N;060XXXX ;067LK;068PCHHB92 ;072JKLS

;073COOPER RIVER BRIDGE ;080NSA;082NSA;086000 ;

I appreciate your help!

Accepted Solutions (0)

Answers (2)

Answers (2)

VijayKonam
Active Contributor
0 Kudos

Fritz,

Since this is a mix of fixed length and also delimitted file format, I would suggest you read it as file delimitted. Define two strucutures, header and line. Use delimiter as \n for the header both fields and record. Then use ; as delimitter for fields and \n for the record for the line.

That way you can read the entire header line into one field and the fields in the next lines in to the fields of XML structure you define.

VJ

Former Member
0 Kudos

Hello. Thx for your help

well i am close to solve my problem but now we figured out that there is one line an the end of the file saying this is the end of file

So we have structure in File like:

#Header

DataRow1

DataRow2

DataRow3

#Header

DataRow1

DataRow2

DataRow3

#Header

DataRow1

DataRow2

DataRow3

DataEndOfFile

So how to get the last line in the content conversion?! Could be a string because we don't need this information!

Can you help on how to solve this last hurdle?!

br

Former Member
0 Kudos

someone?! any ideas?

Former Member
0 Kudos

Hello Fritz,

> #Header

> DataRow1

> DataRow2

> DataRow3

> #Header

> DataRow1

> DataRow2

> DataRow3

> #Header

> DataRow1

> DataRow2

> DataRow3

> DataEndOfFile

>

> So how to get the last line in the content conversion?! Could be a string because we don't need this information!

The easiest way to handle this is to write a simple shell script which will read till the end of file and will remove the last line. This will be done before the File adapter picks the file.

I don't think this can be addressed in the FCC.

Hope this helps.

Regards,

Neetesh

Former Member
0 Kudos

Thx for your help,

we are still on the problem because we have some new requirement.

We have the problem that the DataRows can occur 1 to 5 times.

But how to say the adapter how to handle this with file content conversion?!

#Header

DataRow1

DataRow2

DataRow3

#Header

DataRow1

DataRow2

DataRow3

DataRow4

#Header

DataRow1

DataRow2

DataRow3

DataRow4

DataRow5

DataEndOfFile

Do you have some suggestions?

br

Former Member
0 Kudos

Hi Fritz,

I didnot understand your requirement completely. Are you trying to read the whole file excpet the first line. YOu dont want to read the first line and read the other lines. If yes then you have an option in file sender communication cahnnel.

Regards,

---Satish