I am trying to write database table data to a flat file. The wmFlatFile package is frustrating to understand. Can anyone point me in the right direction.
If you dont want any record identifiers or field delimiters, then
create a dictionary that will have a record with one field.Set the field extractor to Nth Field and set the position ‘0’.
2.Now go to your schema and in ‘Settings’ take the reference of this record from the above dictionary.
In definiton tab, select ‘Delimiter’ as the parser and set ‘newline’ as the record delimiter.
Create a document for this. A document with a doc list ‘recordWithNoID’ should be created with one field under it.
In your flow service, in the loop step, take table records as ‘inArray’ and this flatfile document as ‘OutArray’.
Inside the loop, take a map step and map the specific field from records to this document field.
After the loop, use ‘convertToString’ and convert the flat file doc to string.
Now you can create a java utility that saves a string to file. Use that and save the data to local file.