cancel
Showing results for 
Search instead for 
Did you mean: 

remove header/footer/concatenate?

Former Member
0 Kudos

Hi All,

I'm new to the PI developmental game and am just back from a couple PI classes. I have been tasked with the following as my first developmental challenge and am really not sure where to start. Hopefully someone can point me in the right direction to get this one solved.

I'm currently working on a process that allows our customers to query the location of their product during shipment.

We receive flat text file updates from the shipping company 4 times a day and sometimes in multiple files.

Each file contains a header of undetermined rows and character length

Each file contains a footer of undetermined rows and character length

The file we receive is a text file that is not tab delimited and not in csv format.

The needed data resides between header/footer and has only 3 constants

Constants: the first 10 characters are the individual truck identifier name and as imagined are all unique alpha-numeric

following the rail car identifier is the date in YY/mm/dd format

the last constant is another date at the 40th character in YY/dd/mm format

I need to strip the header/footer and only keep the needed data in between. I also need to concatenate the messages (if there are multiples) in our inbound directory into a single file for outbound after processing.

My idea for processing is to use the truck name length (with a requisite entry length of 10 characters) that must be followed at the 11th character by a valid date in YY/mm/dd format. Using a rule of a requisite valid date at character 40 would further strengthen the guarantee of needed data delivery while further strengthening the removal of the header/footer/unneeded data.

Does this sound like a rational plan and if so does the content conversion have to take place in the file adapter? Inbound or outbound? How to concatenate these files into one?

Any help would greatly be appreciated!

Don

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Donald,

For PI to receive the file you need to use the SENDER file adapter and you can use it with File Content Conversion.

Here are details how to use that: [help.sap|http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm]

and here is some more information on the same:

[more|http://www.riyaz.net/blog/xipi-file-content-conversion-for-complex-structures/technology/sap/79/]

For the concatenation it looks like you will need BPM as mentioned also by the others.

Kr

Robert

Former Member
0 Kudos

Thanks to all who've responded to this one. I'm in the process of mapping it all out and will let you know how it goes. Should be ready for testing in the next week or so!

Thx,

Don

Former Member
0 Kudos

Hi Donald,

Yes, you can achieve this requirement. Follow as suggested by Liang Ji.

In the receiver file adapter using Append in File contruction mode which will append all the data into a single file.

If you would like to process the data for individual day, then you have to go ahead with BPM i.e collect files and append.

Thanks,

Former Member
0 Kudos

Your plan seems to be rational, but are you going to use Java Mapping to achieve your purpose ?

How to concatenate these files into one?

you can use receiver file adapter, the create mode is "append", but do not know is this what you want.

If you just concatenate files during the day, probably you need BPM to collect the files and execute merge multi-mapping program.

Regards

Liang