This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.eager_load! | |
ActiveRecord::Base.descendants # It returns all models and its attributes. | |
ApplicationRecord.descendants.collect(&:name) # It returns only the model names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String charset = "Cp1252"; | |
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("CAMINHO ARQUIVO ORIGEM"), charset)); | |
String line=""; | |
String destiny="CAMINHO ARQUIVO DESTINO"; | |
int count = 1; | |
int fileSize = 0; | |
OutputStreamWriter fos = new OutputStreamWriter(new FileOutputStream(destiny+count+".csv"),charset); | |
while((line = bufferedReader.readLine()) != null) { | |
if(fileSize + line.getBytes().length > 50 * 1024 * 1024){ |