Sign in to follow this  
Followers 0
raminder

Taking text file and putting into excel cells

2 posts in this topic

#1 ·  Posted (edited)

I have a tricky problem I am trying to solve and hoping I can solve and implement it using autoit.

I have a text file which looks like this:

Fred - Away 24/04/2010 25/04/2010

Susan Holiday 14/11/2010 24/12/2010

I then have an excel document where column A is a list of names and B2-X2 is a date e.g.

Name / Date 12/07/10 13/07/10 14/07/10

Fred

Susan

etc

What I want to do is read the text file to find a name then put the next word in the correct cell of the spreadsheet. For example find Fred on the excel document and fill in the cell that corresponds to 24/04/2010 with the word "Away"

Can anybody tell me if this is possible and possibly point me in the right direction to implement it. I'm not asking for the solution to be given to me just some pointers so I can do it myself.

Thank you.

Edited by raminder

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It's absolutely possible...probably several ways to go about it too

The right regular expression and use of the StringRegExp() function should be able to get your name, that next word and all dates in the text file and put in an array for you.

There are some sites out there to help with regular expressions. Check out George's post and his sig has a link to PCRE Toolkit #813223

An online one is www.regexpal.com.

Check out the Excel UDF for working with Excel.

A couple funtions you'll need at the very least are _ExcelBookOpen() and _ExcelWriteCell()

Edited by MrMitchell

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