# REFORMAT - from file to database

**URL:** <https://forum.cloverdx.com/t/reformat-from-file-to-database/371>\
**Category:** CloverDX Platform\
**Created:** [August 13, 2008, 12:00am UTC](https://forum.cloverdx.com/t/reformat-from-file-to-database/371 "2008-08-13T00:00:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![francoise.gerard](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@francoise.gerard](https://forum.cloverdx.com/u/francoise.gerard)\
**Post date:** [August 13, 2008, 12:00am UTC](https://forum.cloverdx.com/t/reformat-from-file-to-database/371/1 "2008-08-13T00:00:00Z")

</div>

Hi,

I’m newbie in cloverETL.  
I’m trying to integrate some data from text file into a table from a database.

I success in copying text file in another textfile, and a table in another table.

For the copy from file to database, I’m using a REFORMAT transformer, but the transformed record number is always 0.  
I’m using the “easy transformation mapping”.

Can someone help solving this? What am i missing?

Françoise

---

<div class="post-metadata">

**Author:** ![jurban](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jurban](https://forum.cloverdx.com/u/jurban)\
**Post date:** [August 13, 2008, 11:30am UTC](https://forum.cloverdx.com/t/reformat-from-file-to-database/371/2 "2008-08-13T11:30:53Z")

</div>

Hi,  
can you please post the graph, or at least the simple transformation mapping? how many records are read as input of the reformat?

Jaro

---

<div class="post-metadata">

**Author:** ![francoise.gerard](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@francoise.gerard](https://forum.cloverdx.com/u/francoise.gerard)\
**Post date:** [August 13, 2008, 11:55am UTC](https://forum.cloverdx.com/t/reformat-from-file-to-database/371/3 "2008-08-13T11:55:57Z")

</div>

I tried the “clover” transform as this :

function transform() {  
$0.objectId := str2num($0.ID\_KF);  
$0.illustrationName := $0.Nom;  
$0.switchCcy := $0.DeviseS;  
$0.productName := $0.NomProduit;  
$0.referenceCcy := $0.DeviseP;  
}

and now it works!

Maybe the “easy transform mapping” is only to map same data type (no string to num conversion) ?

---

<div class="post-metadata">

**Author:** ![jurban](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jurban](https://forum.cloverdx.com/u/jurban)\
**Post date:** [August 13, 2008, 12:04pm UTC](https://forum.cloverdx.com/t/reformat-from-file-to-database/371/4 "2008-08-13T12:04:00Z")

</div>

Hi,  
easy transformation language can do some type conversions, but not all (string to num probably does not work automatically). the easy transformation language (or as we call it Clover Transformation Language Lite) is basically just a simple macro language for Java, so everything except ${field) and @{field} is normal Java source…

Jaro
