Source language: Translate to:

hpwControl question

Questions about NeoBook PlugIns

Moderator: Neosoft Support

hpwControl question

Postby dpayer » Wed Jan 10, 2007 12:19 pm

Hans-Peter,

Your hpwControl plugin has a string parsing command: hpwListParse. When I attempt to use it to parse a file (basically a log file that I want to analyze), I enter the following:

Code: Select all
hpwListParse "[testfilevar]" "[#13][#10]" "" "[newvar]" "[newvarhpwcount]" ""


It parses much faster than the NB string parse. BUT, it does something odd for me. It appears to create a variable array with elements named in the following manner:

newvar11
newvar21
newvar31
newvar41
etc
newvar561

The variables seem to have a one after the name.

Am I misunderstanding the usage of this? Was it intended to be used in this manner?

Another issue that I don't understand is that when I get a row count from the command (see above) it is a different amount than when I use the NB arrayinfo command to get the total number of elements. A couple of the lines are empty, I am sure that is the difference, your product counts those elements, even though they don't get created as variables because their value is empty.

Thanks for your help.

David P.
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby HPW » Wed Jan 10, 2007 1:50 pm

Am I misunderstanding the usage of this? Was it intended to be used in this manner?


Yes, the intented use is to create a 2-dimensional array.
See Page 2 of the sample pub.
[DelimitList] contains a big stringlist with several line where every line is also delimited with a special char (here a |).

So it parses this string into a array where each row represents the lines and each column represents the fields on each line.

Not sure what you want to reach with your parsing.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dpayer » Wed Jan 10, 2007 3:25 pm

HPW wrote:
Am I misunderstanding the usage of this? Was it intended to be used in this manner?


Yes, the intented use is to create a 2-dimensional array.
.


It is working to create the array. I was surprised that it adds the number "1" or a space and then the number 1 after every element of the array. Is that the way it is supposed to work? I am seeing the names given to each element via the Neobook Debugger.

David
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby HPW » Wed Jan 10, 2007 11:28 pm

David,
dpayer wrote:It is working to create the array. I was surprised that it adds the number "1" or a space and then the number 1 after every element of the array. Is that the way it is supposed to work? I am seeing the names given to each element via the Neobook Debugger.


See Page 2 of the sample pub.
[DelimitList] contains the big stringlist which has the line delimiter [#13][#10] yet.
So it is expected by hpwListParse that the stringlist has lines with line delimiter [#13][#10]. What you specify as the delimier is used for parsing the line-content.

Code: Select all
hpwListParse "[testfilevar]" "LineInputdelimiter" "ArrayNameOutputDelimiter" "[OutputVarPrefix]" "[newvarhpwcount]" ""


Still not clear what you want to do?
Maybe you should have a look at the RegularExpression functions of hpwControl.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest