base64 encoding .txt file

i managed to resolve my second problem, because it was easier than first one, now i am trying to solve first problem.

this code read a long line by reading each symbol and storing it at "inData" and at the same time int "sk" counts wich symbol from begging it is, to see if it has reached 60th symbol or 120th symbol or 180th symbol .... it simply divide "sk" with 60 and if obtained result is natural number , then we know that "inData" has stored 60 symbols and we cah print them out and clear "inData" and store to it next 60 symbols. to deal with last line if it is smaller than 60 symbols, it reads how large is file and subtract 60 from it and the compare obtained result with "sk", if sk is greater than obtained result then it print out last read symbols.

here is code that reads long line who is in text file and split it to multiple lines:

// adding libraries
#include <SD.h>
#include <Base64.h>
#include <Streaming.h>
#include <SPI.h>

float u = 0;    // define a float number, who will help to identifie if string "inData" contain 60 symbols
File myFile;
File base;	
float i = 60.0;  // define how long  lines will be. how much symbols will be on each line
int sk = 0;	// define int who will show how much symbols are read
String inData;	// define string where read symbols from base.txt will be kept


void setup() {
   Serial.begin(115200);
   Serial.print("Initializing SD card...");
   pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);   
  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");
}
void loop()
{
  char var = Serial.read();
switch (var) {

case 'u':
   {
     Serial.println("lasa");
             base = SD.open("base.txt", FILE_READ);
            while(base.available())    {  // reading file from start to end only once
              char a = base.read();   // store read value to "a"
           inData += a;  // storing read values to "inData"
           sk++; 		//for each read symbol from base.txt add +1 value to 
           u = (float)sk/i;		// here we calculate "u" ,who later will allow us to know when 60 characters or symbols are read from base.txt  
           if (u == floor(u)){   // if u is natural number, without any decimal places, do ...
             Serial.print(inData);  // print stored 60 characters and add new line symbole
             Serial.println(); // and add new line symbole
             inData = 0;
           } 
           else if ((base.size()-i) < sk) {  // if we read last line who are less than  60 symbols, print it too
                                             // it has been done by reading file size, 
				             //  then subtracting from it 60 symbols and
				             // obtained result comparing with "sk" 
				             // (int wich shows us how much symbols are read)
					     // if sk is greater than obtained result , 
					     // then we know that there are left less than 60 symbols
             Serial.print(inData);
             inData = 0;
           } 
           }
        
           base.close();
   }
    break; 
}
}