ruby - Unexpected keyword_end error, yet syntax seems fine -
This function is used to retrieve the name of a value file comma-separated and treated them in an array. I would like to be sent to solve a current question As my happiness will be answered to someone directly to answer me Your error line Comes from. Ruby should be no such syntax: what's more, you should be your regexp make incorrectly: There may be some other errors that I did not pay attention to
def xprt_csv_to_ary (csv_file) namecatcher_regex = "/^[\.{1}]([AZ]+)\.{3}/" # next name current_word = 0 names_array first = Match up to four [] while current_word & lt; 5000 If current_word == 0 Name = csv_file.readline.match (namecatched_regex) and name = csv_file.past_match.match (namecatcher_regex) names_array end [current_word] = name current_word ++ finally return names_array
syntax error, unexpected keyword_end
current_word ++
current_word + = 1 < / code>
namecatcher_regex = /^[\.{1}]([AZ ] +) \. {3} /
Comments
Post a Comment