View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Copying certain lines from a text file

How about importing the whole file into a new worksheet in a different workbook.

Then select column A
Edit|Find
[SC}
Then come up two rows
then Shift-ctrl-home
to select that cell through A1
Edit|Delete|entire row

Then select column A again
With A1 the activecell
Edit|find
[SC]
But shift-click-Find Next
This will start at the bottom and work it's way up to find the last [SC] in the
column.

Come down a couple of cells
select that cell
Shift-Ctrl-End to select that cell through the last used cell

Edit|Delete|entire row

And copy what's left to its proper home.


Michael A wrote:

Hi, I have a text file with 30,000 lines. I need to figure out a way to copy
only the lines that start with [SC] and the surrounding lines (1 above, 1
below) to my excel sheet. I can import the whole sheet into excel, but I cant
figure out how to sort it and still keep the 3 lines I need together.. Any
help pls? Thank you!


--

Dave Peterson