LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default How to parse data in text file

Hi,

I am trying to read data from a no of Text files (usually of same
format, i.e. 1 table of 2 columns.)into an excel sheet.

e.g. The Data in TEXT file looks like:

Fill Across dotted lines.....
Blank
Mail Subject: FlashLite Order
Blank
Blank
Agent Name: | Smokey Joe
Teams Name: | Mavericks
Date : | 07/10/2005
Time : | 10:00 PM GMT
Blank
Blank
Subscriber#:| FS2212WE
Work ID : | 1234

So, if you see, the Label & Value seperator is a ":" (except for Time).
Also, there are blanks in between the lines.


Now, i have a worksheet with Similar Labels (except Mail Subject which
will be the name of the worksheet to Activate)for Column Headers
starting from "A1".

What i am trying to do is to read each line into a variable (Except
First Line "Fill across dotted lines..."). Discard any Blank lines.
So variable will contain both Label & Value. Then Split & Trim this
variable into 2 parts at delimiter ":", & then get it into an Array.
So Array will contain Label first & then Value e.g. & will not contain
any Blank values.

MyArray(0)=Label1
MyArray(1)=Value1
MyArray(2)=Label2
MyArray(3)=Value2
etc....

Once Array is created, Activate the worksheet with name "FlashLite
Order" from MailSubject value in TEXT File, Compare Labels in Array
with Column Headers in Excel Sheet, & then dump corresponding values
for text file labels under the Excel Column Headers.

Please Help!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse Text Erin Excel Discussion (Misc queries) 1 June 18th 09 10:17 PM
Parse File Location Mike Excel Worksheet Functions 5 October 3rd 07 04:05 PM
Need to parse column data only when text is present Phil Excel Worksheet Functions 0 July 10th 07 08:22 PM
Wish to parse through a text string to find data Neil Bhandar[_2_] Excel Programming 2 October 24th 03 07:04 PM
Parse Text File John[_62_] Excel Programming 5 October 22nd 03 02:50 PM


All times are GMT +1. The time now is 09:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"