Results 1 to 2 of 2
Thread: Row capturing from txt file
2012-04-22, 02:06 #1
- Join Date
- Apr 2008
- Thanked 0 Times in 0 Posts
Row capturing from txt file
I want a macro in excel that can enable me to capture a certain portion from a text file and import it in excel.
Here we go...
We have a webpage from where I use to copy and paste the data into a notepad. Now, when I copy and paste it into notepad, a lot of unwanted data gets copied which is pretty obvious. After that I save this txt file on to my desktop.
Now I want that when I import the data of that particular txt file into excel it should only copy and paste the row which has "File_" in it or if possible that word that contains "File_".
Also, every word with "File_" must be in a single cell.
I am attaching the text file and the excel file as to how the data should look like.
Thanks in advance for any help on this.
2012-04-22, 03:27 #2
- Join Date
- Dec 2009
- Thanked 976 Times in 906 Posts
I would do the following in Excel.
1. Paste the data into a blank sheet.
2. Sort the data to get all the "file_" lines together.
3. Delete unwanted rows / cells.
A macro to do this would almost write itself if you use the macro recorder.
You could paste the data direct form the web page as it appears to be formatted OK in the text file. Use Paste Special > Values to remove the formatting.