Hello,
I have problems in saving strings extracted from a .txt file in an Excel File.
For example in the .txt file there is a text:
Immatricolazione
6 / 2006
I saved the value 6/2006 in a string variable called Immatricolazione, using regular expressions.
Since there where some empty spaces in the string I manipulated it with the
String.Join option.
When I save the variable in the Excel file it inserts a date in the cell giu-2016 and not the value extracted.
I also tried to convert the string to a DateTime and then back to a string
but it didn’t work.
Can anyone kindly help me in solving the problem?
Thank you so much.
Camilla.
Silviu
(Silviu Predan)
March 13, 2018, 2:56pm
2
Hi Camilla,
Excel is interpreting that string as a Date value. You can prevent this by having an apostrophe (‘) before you enter a number, eg. '1 / 2016
Check this article on how to prevent excel to automatically changing numbers to dates.
Regards
Silviu
3 Likes
Thank you so much @Silviu , it solved my problem.
Now I get the correct string inside the Excel File.
Thank you so much for your help.
Camilla.
avene
(Avene)
July 5, 2018, 6:22am
4
Hi CamiCat!
I am currently working on a project and trying to convert a txt file into Excel (just like how u did) into different columns.
How did you do it? Could you share your XAML file?
Thanks!!
Avene
1 Like