• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extract specific data from text file

mahesh402

New Member
I have this text file which shows data like
GL CODE. GL DISCRIPTION. DEBIT. CREDIT
14355 Mt two wheele. 67895000. 9876555
15367 MT CON LOAN. 8769762 7655444
14567. MT NON CON. 4356278. 4526727

but the problem is there is too much unwanted data prior to this and after this. I tried text import wizard but there are too many files that makes it time consuming...I also tried the code suggested in similar post and even tried to modify it but no succese. I want code discription debit and credit in different column...GL CODE is of five digits and then there is text again there are figures in debit and credit
And there is also one thing there are total of 4 column sometimes I require Code debit and credit and sometimes all four so code must be flexible
 

Marc L

Excel Ninja
Restart from here :​
 

mahesh402

New Member
Restart from here :​
Thanks for reply sir.... I have read all the things in the post and I am sorry that I could not represent myself better. But what I have to do now....repost it..?? Sorry to bother you but please help me out here
 

mahesh402

New Member
Please post your query in Excel section. Currently it is under VBA Macros and also try to attach txt file which give more clarity please.
Thanks for reply. But I need a vba macro code for extracting a particular data from text file. That is why I have posted it here.secondly text file is confidential and company policy do not allow me to share it. But I already have tried to show what data looks like in text file and what kind of output I require. Please look and thanks again
 

Marc L

Excel Ninja
But what I have to do now....repost it..?
Once you well read at least the post #2 link in particular the part How to get best results then,​
as after all we are not on a mind readers forum, just well explain here (not in the Excel section) your need​
with all the necessary files attached, both explanation & attachment smart enough …​
 

mahesh402

New Member
I am attaching a text file please have look at it..I am trying to fetch only 5 or 7 records from the file with codes 33052, 34232,18113,39001 and 39011.thanks any waz
 

Attachments

Marc L

Excel Ninja
Attach the expected result workbook saved as binary .xlsb with two sheets :​
  • a Settings sheet with the list of codes to import (this info should have be given in the initial post ‼)

  • a filled result sheet with the exact layout expected result according to the Settings sheet and your previous text file attachment …
As a reminder : you will have to amend the code (just for starters) for all you forgot to elaborate & attach …​
 

Marc L

Excel Ninja
Attach the expected result workbook saved as binary .xlsb with two sheets
Can't the sheets be located within the same workbook as I asked for ?​
If yes, attach the workbook saved as binary .xlsb …​
I give it a try and it's easy with the text import wizard, no issue …​
 

mahesh402

New Member
Thanks for reply ....I made the result sheet with text import wizard but the real issue is text file I attached I already have deleted the data prior to this codes and also I only need few of the codes after importing data I have to manually cut the unwanted data and also there are around 718 text files ...that is why I humbly request you to please help me
Thanks in advance and I am sorry about binary.xls I will upload it tomorrow as u asked right now I am little bit away from my pc
 

Marc L

Excel Ninja
After the text import wizard it's easy just using other Excel basics via a formula and a filter or an advanced filter​
like an Excel beginner can yet operate manually, you will see tomorrow …​
 
Top