cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore first and Last recorde from the file

Former Member
0 Kudos

Hi All,

In my scenario I have to Ignore first and Last records from the CSV file.Option Record offset is only to ignore no. of lines at the begining.Which option that I have to use to ignore first and last records together.

Thanks in advance

Kartikeya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For sender adapter, enter a value for the following parameter in the configuration:

Document Offset: Specify the number of lines that are to be ignored at the beginning of the document. This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines.

Regarding the last lines,,,,

1.you can do that by writing a commondline script if have unix operation system iam not sure if we can do that same by in windows by ingoring the last line of a file.

or

2. wirte a Module Processor code

3. wirte a UDF in mapping and and not map the last four lines but you need to check for every field.

*********Reward points,if found useful

Former Member
0 Kudos

Hi BVS,

Could you please provide me the UDF or module processor code for this requirement as I am not aware of JAVA.

Thanks in Advance

Kartikeya

Answers (4)

Answers (4)

GabrielSagaya
Active Contributor
0 Kudos

If you use keyfield in your structure pointing to First Value,

then you can use

NameA.fieldNames=XXX,a,b,c,YYY

NameA.keyFieldValue=XXX

NameA.keyFieldInStructure=Ignore

You can use

NameA.additionalLastFields=Ignore

Hence you can ignore first and last records

Converting File Content in a Sender Adapter

http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm

Former Member
0 Kudos

Hi All,

Thank you for your reply but I am looking to ignore the last record not for the last fields. Any suggetions.....

Thanks in advance

kartikeya

Former Member
0 Kudos

hi

pls check the bel;ow blog

/people/sukumar.natarajan/blog/2007/06/12/content-conversion-in-sender-file-adapter--2-new-useful-parameters

(header.additional last fileds = ignore

item.additional last fields = ignore)

regarsd

chnadra

Former Member
0 Kudos

hi

pls check the below blog

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

(ignore Record set name= true)

regards

chandra

Former Member
0 Kudos

hi

try with

ignore.Additional last fields

regards

chandra