If only

  1. I wish I could visit America. If only I were a rich man!
  2. I wish I could visit America, if only I were a rich man!
  3. If only I were a rich man I could visit America.
    Which one is grammatically correct?

#1 is OK. #2 is badly punctuated. #3 is not wrong, but might benefit from a comma after “man”.