CSV Import Problem

4 years 3 months ago #1052 by Frank
Replied by Frank on topic CSV Import Problem
I have been retesting a lot, and no matter what I can't reproduce your issue. I created an empty project, downloaded the latest I2 Loc, and created an script with the code you posted.
using UnityEngine;
using System.Collections;
using System.IO;
using I2.Loc;

public class test : MonoBehaviour 
	void Start () 
		string CSVstring;
		CSVstring = File.ReadAllText(Application.streamingAssetsPath + "/fr.csv");

		LocalizationManager.CurrentLanguage = LocalizationManager.CurrentLanguage;
		LocalizationManager.Sources[0].Import_CSV(string.Empty, CSVstring, eSpreadsheetUpdateMode.Replace, ';');

It loaded the fr.csv without adding any \r at the end.

Can you please try that and load the fr.csv you posted here.
I'm thinking that it may have something to do with some other assets or scripts in your project. Or that the fr.csv file doesn't have the same issue than the one you are using.

BTW, I tested on unity 4.6 and 5.2. Both on Windows. Haven't been able to test on Mac yet.
Are you using windows or mac?

Sorry for this issue, and as soon as I get able to reproduce it I will include in all future updates.

PS. BTW, a safer and better way to load the CSV from the file, its by using
var CSVstring = LocalizationReader.ReadCSVfile( filename );

That function replaces any \r\n and \r by \n and also works correctly in Metro and W8P.
Nonetheless, even with the code you sent me I'm not able to reproduce the \r issue.

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

3 years 11 months ago - 3 years 11 months ago #1232 by wagenheimer
Replied by wagenheimer on topic CSV Import Problem
var CSVstring = LocalizationReader.ReadCSVfile( filename );

This worked for me! Now it works as expected!

Thanks! =)
Last edit: 3 years 11 months ago by wagenheimer.

Please Log in or Create an account to join the conversation.

Time to create page: 0.111 seconds
Template by JoomlaShine