|
Anthony's VBA Forum Where the knowledge is shared |
|
|
View previous topic :: View next topic |
Author |
Message |
seema
Joined: 27 Nov 2008 Posts: 1
|
Posted: Thu Nov 27, 2008 7:29 am Post subject: extract and compare data of text files through excel |
|
|
Hi All,
I have just joined, and am struggling with the following:
Need to extract and compare data from two text files. Data in these files is separated with pipes. I only need to extract relevant data and while comparing; I need to take out the difference between two data points. The problem that I am facing is that the pipes are not separated uniformly. And I am finding it difficult to extract the relevant data.
I need to do the following steps:
1. Extract relevant data from both text files.
2. Transfer the data to another output file in text format (since the record exceed 100K).
3. Take out difference of values between two data points
4. Prepare a summary.
Data in File 1.
14|FN|AAA|4|3.14|2||1||+1|1800|S|A|1-1974||NA|NA|BSSM|MANAGER
10|VIN|PPP|4|3.0|46||||162|22|AD|D|1-1970||NA|NA|AEBS|BRAN
Need “14” ,“AAA” ,“4”,”3.14”, “BSSM” data points from line 1 in file 1.
Need “10”,“PPP”, “4”, “3.0” , “AEBS” data points from line 2 in file 1.
Data in File 2
Would have similar records as file 1.
Extract : BSSM and AEBS data points are employee names , 3.14 and 3.0 are amounts. 14 and 10 are unique identifiers.
BSSM and AEBS is hypothec data and can vary, but the character length is fixed.
Unique identifier is hypothec data and can vary, by the length is fixed.
I need the difference of amounts in file 1 and 2 for respective employees against their unique identifiers in another text file.
This I want to do a subtotal in excel. The text files have more that 100,000 records in each.
Pls assist.
Thanks |
|
Back to top |
|
|
mohan.ankur Moderator
Joined: 02 Aug 2006 Posts: 52
|
Posted: Fri Dec 19, 2008 3:17 pm Post subject: |
|
|
You can open the text file in excel. Just like you open the excel file.
You can even record opening the text file.
When you open the text file you should see a text import wizard in which you can specify the delimiter you want to use to separate the data while importing it in excel.
In your case as it is clearly visible it should be "|"
Hope this helps
Ankur _________________ http://www.exceldepot.com
http://www.xlmacros.com
http://www.learnexcel.org |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|