Data change from format to export to excel

Hi there!

I am exporting a list of sheet information to excel which include some data that seem similiar to a date.

For example, I have a paramter in Revit with information like this: “18-MAY”, “20-NOV”, … And other parameter has data like this: 1/1, 1/2, 2/2…

The problem is when I export this information to Excel and the data format is changed to date format.

How can I avoid this? I want to export all data as string without any format change.

You could try with BumbleBee package with Write Excel node.
I didn’t try, so no guarantee.

Or maybe you can convert your date into strings with String from Object node.

Don’t know if there is an updated version of BattleBim for 2.x but you can try this maybe

Try adding a ‘ character before each of the values. I believe this will force excel to read the data as a string (which is what your data is).

6 Likes

I have tried the second option you propose but didn´t work. I am trying the Bumblebee package but this node it taking years to export…

I think @JacobSmall is correct. It isn’t the data format going out, it is a function within Excel that just “sees” the data as a date / time format and automatically formats it.

Another option would be to Pre-Format your Excel file and tell it the cells / rows / columns that you need are to be string and not date. I have done this in the past for various things as well.

2 Likes

Yes, adding a ’ might solve the problem but adding to another step in excel to correct de data.

Pre-format the Excel file don´t work for me because I need to overwrite it

‘1/1 should read as 1/1. The ‘ is a special character in excel which ‘forces’ a string format. Give it a shot and see if it helps.

Another possible solution would be to convert the values to a decimal (Sting.Split node, String.ToNumber node, and a x[0] / x[1] code block), store the number as a decimal, and then convert it to a fraction in excel via formatting. This may get messy if you have odd denominators though.

1 Like

Finally I decided to use JacboSmall solution. I inserted a ’ before every element of the list and now the info is exported correctly in Excel

1 Like