Sign in to follow this  
Followers 0
Fewmitz

Copying certain text and adding it to an array

2 posts in this topic

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.

Share this post


Link to post
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

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