Jump to content

Copying certain text and adding it to an array


Fewmitz
 Share

Recommended Posts

Okay, this is sort of like wanting to copy lines of text, but it's character based.

If there was a file on my computer like this:

~~~~

google:6

yahoo:5

ask:3

~~~~

How would I write the code to read line 1, copy all the text up to the colon (google in line 1) to one array, then the text after it (6 in line one) to another, and then move to the next line?

I know the basics, and it seems like I'm missing something incredibly basic, but I can't figure it out.

Link to comment
Share on other sites

Okay, this is sort of like wanting to copy lines of text, but it's character based.

If there was a file on my computer like this:

~~~~

google:6

yahoo:5

ask:3

~~~~

How would I write the code to read line 1, copy all the text up to the colon (google in line 1) to one array, then the text after it (6 in line one) to another, and then move to the next line?

I know the basics, and it seems like I'm missing something incredibly basic, but I can't figure it out.

_FileReadToArray() and then do a For/Next loop through the array. Post some code if you get stuck.

<_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...