string rootAssetsFolder = "Assets/myFolder/{0}"
string result_assetPath = string.Format(rootAssetsFolder, "test.txt");
//I tried delete and recreate, but it still does not work
AssetDatabase.DeleteAsset(result_assetPath);
//I write it as driverpath, this is direct and simple. besides I dont know how to write it in Assets path
string driver_path = projectFolder + result_assetPath;
File.WriteAllText(driver_path, content);
// I tried reimport call.
AssetDatabase.ImportAsset(string.Format(result_assetPath, "test.txt"), ImportAssetOptions.Default);
the code above does run, hoever the asset never refreshes…
why?
Maybe you can try AssetDatabase.Refresh()? It might be required, not sure.
no, it still doesn’t work.
I’ve really wasted some time on checking the asstes.
what a headache!
all right, it is not an issue now. it probably is my logic problem
Did you find a solution?
After duplicating some .txt that contains some of my game dialogues, they appear like this in inspector:

My Dialogue script detects it like null or empty (is not displaying any line of the dialogue), but the file is not empty, when edit the .txt the dialogue it’s there.
I’ve tried Reimporting the files, AssetDatabase.Refresh(), AssetDatabase.ImportAsset… but nothing works