Jump to content


Photo

Parsing a line


  • Please log in to reply
6 replies to this topic

#1 Ken1

Ken1
  • Members
  • 22 posts

Posted 08 June 2012 - 07:40 PM

How can I pass a line of strings like:

LEE, "Lee Enterprises, Inc.", 51672
GGG, "Geter Enterprises", 56782

to be an array. For instance, the name of the array will be m where m[1] will equal LEE, m[2] will equal "Lee Enterprises, Inc." and m[3] will equal 51672. I tried using RegExMatch but it messes it up. This is the RegExMatch line I have:

RegExMatch( A_LoopField, "(.*?),(.*?),(.*)", m )

It messes it up splitting the Enterprises and the Inc in example one up. This is the output: m2 will be "Lee Enterprises" instead of "Lee Enterprises, Inc." . Any help would be appreciated.

#2 Guests

  • Guests

Posted 08 June 2012 - 07:55 PM

First, remove the spaces following each delimiting comma. Then, you can use Loop Parse, line, CSV to parse the line correctly.