input: Write a function to modify the given Python code to handle errors. The function should be able to read data from a JSON file. If the file does not exist or is not in a valid JSON format, it should print appropriate error messages. If everything is successful, it should return the data from the JSON file.
  assert read_data_from_json("valid_file.json")!=None
  assert read_data_from_json("non_existent_file.json")=="The file specified does not exist."
  assert read_data_from_json("invalid_format.json")=="The file specified is not in a valid JSON format."
output: import json
  
  def read_data_from_json(file_path):
      try:
          with open(file_path, 'r') as file:
              data = json.load(file)
              return data
      except FileNotFoundError:
          return "The file specified does not exist."
      except json.JSONDecodeError:
          return "The file specified is not in a valid JSON format."