Flat File Schema

Hi,

I am trying to write to a flat file the data from a canonical. I want the data in the flat file to appear in seperate line when ever a new record is appearing. I have mentioned newline in FlatFile definition whiole designing the shema but still it is not coming in seperate line. Do let me know the solution.

Regards
S.Lavanya

Lavanya

If you select delimiter based setting record parser=newline in the FFSchema it should definetely work when ever record repeats.

Please tell us about your Schema layout if it is fixedlength or delimiter based?IS your RecordDefinition properties/maxRepeat=unlimited??

HTH,
RMG

Hi

We have designed the shema with delimiter based setting record parser=newline. In the file at the end of each record a delimitor symbol is coming but we are not getting the record key in different line.

While writing to the file we tried using \n operator but it is not giving the desired output.

Regards
S.Lavanya

Basically before you step to flatfile:convertToString trim all the fields and as for testing copy your string from the pipeline and paste it in a notepad or ultraedit text editor to make sure the string record delimiter is newline.If everything looks good then writeToFile.

HTH,
RMG

Hi,

We have created a flat file using a shema. The text file is being opened with each record in a newline when attempted to open with MS-word,wordpad or editplus which is our desired output. The sane file when tried to opened with notepad, the data is getting wrapped. A delimitor symbol is coming instead of newline. Is this due to editor property or do we need modify our shema.

Regards
Lavanya

Keep in mind that end of line (EOL) is represented differently on different platforms. On Windows it is carriage return and linefeed (\r\n). On Unix it is just newline (\n). On Macs it is just carriage return (\r).

Adding to the fun is that different editors treat EOL markers differently. Newer versions of Notepad show files with only \n for EOL as you would expect. Older versions (just a couple of years back) do not as they only wrapped lines when \r\n were present. Wordpad and such can do different things as well.

To confirm that the file has what you want, use a viewer that is capable of showing the raw binary file and does not perform any EOL normalization (TextPad is one that can open files in binary mode).