Sign in to follow this  
Followers 0
Arcade

Search Engine Script help!!!

4 posts in this topic

Hi, i need to convert the information in a variable to a vector, for example:

In the .txt the line has things like this:

Time in | Time out | Subject | Something

I need to convert this in:

$Var[1] [0] = time in

$Var[1] [1] = time out

$Var[1] [2] = subject

$Var[1] [3] = something

References:

Var = variable

1 = number of the line in the .txt

If anyone can help me i will be very gratefull.

Share this post


Link to post
Share on other sites



FileRead -> read the file content in a variable

$myVar = FileRead($file)

StringSplit -> to split the above variable in lines (@CRLF delimiter) -> an array of lines

$myLineARRAY = StringSplit($myVar, @CRLF, 1)

StringSplit every line of the above array ( "|" delimiter) -> every line of the text file will become an array of values

For $i=1 To $myLineARRAY[0]

$myLineContent = StringSplit($myLineARRAY[$i], "|")

Next

Good luck,


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

FileRead -> read the file content in a variable

$myVar = FileRead($file)

StringSplit -> to split the above variable in lines (@CRLF delimiter) -> an array of lines

$myLineARRAY = StringSplit($myVar, @CRLF, 1)

StringSplit every line of the above array ( "|" delimiter) -> every line of the text file will become an array of values

For $i=1 To $myLineARRAY[0]

$myLineContent = StringSplit($myLineARRAY[$i], "|")

Next

Good luck,

Sorry but how i get the data that i have to put in the $myLineContent

My problem is that i can find all the table but not a single celd

For example:

|word1...word2...word3|

|word4...word5...word6|

|word7...word8...word9|

How i get the word5 for example?

And also can i use $Array[0][0]="Upper-Left" to find the celd?

Thank you soo much for your time :)

Share this post


Link to post
Share on other sites

Read the help for StringSplit and have a look at the example there - you will get an idea for sure.

Read also about arrays because that is needed too.

This example will help too - try to understand it and you'll be able to do your homework:

#include <array.au3>
$data = StringSplit("Time in | Time out | Subject | Something", "|")
_ArrayDisplay($data)
For $i = 0 To $data[0]
    MsgBox(0, "array elements", $data[$i])
Next

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0