WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('in-progress') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('pending') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

update a file in java | Loop and Break

update a file in java

to update a file first we have to read from file and then update the contents of that file.

 import java.io.*;

public class UpdateFile {
  public static void main(String[] args) throws Exception {
    File f = new File("c:/new.txt");

    // check if file exists or not
    boolean exists = f.exists();

    StringBuffer buffer = new StringBuffer();
    String str;
    BufferedReader br = new BufferedReader(new FileReader(f));
    while (true) {
      str = br.readLine();
      if (str == null)
        break;
      buffer.append(str);
    }
    String st1 = "All";
    int c1 = buffer.indexOf(st1);
    buffer.replace(c1, c1 + st1.length(), "Some");

    String st2 = "not gold";
    int c2 = buffer.indexOf(st2);
    buffer.replace(c2, c2 + st2.length(), "Diamond");
    br.close();
    BufferedWriter bw = new BufferedWriter(new FileWriter(f));
    bw.write(buffer.toString());
    bw.close();
  }
}
Share

You may also like...