cancel
Showing results for 
Search instead for 
Did you mean: 

Text to Xml-Header Line

Former Member
0 Kudos

Hi

In text to xml scenario...how to eliminate the headers in text file

Text file data is like

H1-header line1

H2-header line 2

E100 Rahul - Data

E101 Siva - Data.

I need only data in xml file..what setting i have to make in file content conversion parameters in sender side..In blogs it is given for text to xml..In those i am not getting regarding header line removal from text file (sender)

Give some suggestion to get this scenario

Regards

Prakash

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

if you want only the data in the XML file do not map the header data during the mapping, only map the data nodes. and you will get only the data part in the target.

Former Member
0 Kudos

Hi all,

Thanks for replying..if i get the headers in middle of document..how to skip that headers in output file..

Sample data..

H1

H2

S100

S102

H1

H2

S03

H1

H2

S04

S05

How to eliminate H1 and H2..to get only data(S100,S102,S03..)

Regards

Prakash

Former Member
0 Kudos

just see my first reply in the same thread.

Do not map source header to target herder. And thus you will never get the header data.

Regards,

Sarvesh.

santhosh_kumarv
Active Contributor
0 Kudos

Hi Prakash,

Use the Document Offset to specify the number of lines that are to be ignored at the beginning of the document in your case it is going to be 2. 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.

If the header lines are going to vary between files i.e 2 lines in one file and n lines in someother file then it is better to leave the source header node unmapped with the target node.

Regards

San

Former Member
0 Kudos

Hi Prakash,

Create the Data type with all fields (Headr & Item) but while mapping do not map the header filds to target. But in your Content Conversion Define every thing (Header & Item filed lengths etc.) so this way your file will be ficked up by adapter and while mapping only Item values will be mapped and you will get only item data in your XML file.

Below is the example when you have HEADER & ITEM structure.

FCC is case sensitive, give all the names in FCC same as your Data Type.

In Recordset Structure = Header,1,Item,*

Header.fieldFixedLengths = (field lengths) e.g. 1, 4, 7

Header.fixedLengthTooShortHandling=ignore

Header.endSeperator='nl'

Item.fieldFixedLengths = give the item field length as shown above

Item.endSeparator = 'nl'

Item.lastFieldsOptional = YES

Regards,

Sarvesh

****Reward points, if found helpfull.

arunneerolil
Contributor
0 Kudos

Hi

Set the offset as 2 in the Content conv params.

it will ignore the the first 2 header lines.

rgds

Arun

Former Member
0 Kudos

Hi,

Setting the Offest as 2 will help only when your are sure that you have to ignore only 2 lines, but in case if the header data comes into more than 2 lines or it is variable, in that case offset value will not work.

Regards,

Sarvesh

Former Member
0 Kudos