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.

  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    I am getting the following error:  
  syntax error, unexpected keyword_end   

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.

  current_word ++   

Ruby should be no such syntax:

  current_word + = 1 < / code>  

what's more, you should be your regexp make incorrectly:

  namecatcher_regex = /^[\.{1}]([AZ ] +) \. {3} /   

There may be some other errors that I did not pay attention to

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -