# Node-Red CSV datatype

**URL:** <https://discourse.nodered.org/t/node-red-csv-datatype/43081>\
**Category:** General\
**Created:** [23 March 2021 12:06 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081 "2021-03-23T12:06:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eintracht00](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@Eintracht00](https://discourse.nodered.org/u/Eintracht00)\
**Post date:** [23 March 2021 12:06 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/1 "2021-03-23T12:06:05Z")

</div>

How can I make that my CSV File that my lines are formatted, because if i get data like "7.2" as float.  
it makes me in the CSV btw. Excel 7. Feb, because it thinks automatically that its a date

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 March 2021 12:17 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/2 "2021-03-23T12:17:55Z")

</div>

If you open the file using a text editor rather than opening in excel what does it show?

---

<div class="post-metadata">

**Author:** ![Eintracht00](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@Eintracht00](https://discourse.nodered.org/u/Eintracht00)\
**Post date:** [23 March 2021 12:40 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/3 "2021-03-23T12:40:01Z")

</div>

it shows the 7.2 that i want to get in excel too..

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 March 2021 13:25 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/4 "2021-03-23T13:25:28Z")

</div>

So what change do you want to the CSV file? If it shows 7.2 then what change could be made to the CSV file that would fix the problem?  
Is it not just a matter of telling Excel to format that column as a number not as a date?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 March 2021 14:45 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/5 "2021-03-23T14:45:21Z")

</div>

I see you are asking how to transmit CSV to SQL in another thread.

Are you saving node-red values to CSV then trying to read the CSV into SQL?

Can you not just forget about CSV altogether? Just send data directly to database?

Regarding CSV - for starters, CSV is a rubbish format and has no real means of telling a database (or Excel) what format each data item is. Bottom line (IMO) use CSV ONLY when you are forced to, e.g. to support some other rubbish system or bad IS team who still believe it is 1995 and FTPing CSVs are the answer to all transactions.

---

<div class="post-metadata">

**Author:** ![Eintracht00](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@Eintracht00](https://discourse.nodered.org/u/Eintracht00)\
**Post date:** [24 March 2021 10:49 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/6 "2021-03-24T10:49:19Z")

</div>

I get the data in my MSSQL.  
Than I select it from this MSSQL to get a Backup File with the Logs in CSV. But If some entries doesn't change because the data don't changed already. It should not do me another entry in my CSV. So i want get a duplicate row in CSV.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 March 2021 10:56 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/7 "2021-03-24T10:56:25Z")

</div>

> [@Eintracht00](#):
>
> Than I select it from this MSSQL to get a Backup File with the Logs in CSV.

Whats wrong with doing SQL DB backup using SQL methods?

Any how, if you want to dump a table and avoid duplicates then you probably need a flag in the table that you update to indicate the row has already been dumped to CSV.

e.g. after you backup, set a field in the table to indicate it has been backed up.  
`update mytable set [dumped] = 1 where some_field = some_criteria`

then your backup would select `select * from mytable where dumped != 1`

Alternatively, if you have a sequential `id` column, keep a record of how far you have backed up and only select records \> `id`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 April 2021 10:56 UTC](https://discourse.nodered.org/t/node-red-csv-datatype/43081/8 "2021-04-07T10:56:30Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
