Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Import only certain rows from text file

I have a .txt file that I need to import into Excel as fixed length. I need
to import all the odd rows from the .txt file into worksheet 1 and then
import all the even rows from the .txt file into worksheet 2.

Any ideas on how I would do this?

Thanks,

Mike
  #2   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Import only certain rows from text file

I think you will need to impert them into one sheet.
then you can select only even rows through many methods
helper column with =mod(row(),2)+1
select the helper column copy and paste special values
select all and sort by helper column
select all the rows with 2 in the helper column and cut and paste into sheet 2


"MikeD1224" wrote:

I have a .txt file that I need to import into Excel as fixed length. I need
to import all the odd rows from the .txt file into worksheet 1 and then
import all the even rows from the .txt file into worksheet 2.

Any ideas on how I would do this?

Thanks,

Mike

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Import only certain rows from text file

The only problem with that...and maybe I was not clear enough...is that I
need to parse row one into columns and the fields in row 2 don't match up the
same as row one. Essentially i need to split all odd cells into one fixed
length spreadsheet and all even cells into a different fixed length
spreadsheet.

"bj" wrote:

I think you will need to impert them into one sheet.
then you can select only even rows through many methods
helper column with =mod(row(),2)+1
select the helper column copy and paste special values
select all and sort by helper column
select all the rows with 2 in the helper column and cut and paste into sheet 2


"MikeD1224" wrote:

I have a .txt file that I need to import into Excel as fixed length. I need
to import all the odd rows from the .txt file into worksheet 1 and then
import all the even rows from the .txt file into worksheet 2.

Any ideas on how I would do this?

Thanks,

Mike

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Import only certain rows from text file

How about importing all the data into one worksheet in one column (column A).

Then insert a new column A and insert that formula into it.

Then you can convert those formulas to values, and sort by that column.

Then cut the bottom half (of column B) and put it A1 of a new worksheet. And
use Data|Text to columns to parse that the way you want.

And then on the original worksheet, delete that helper column A and use
data|Text to columns to parse that the way you want.


MikeD1224 wrote:

The only problem with that...and maybe I was not clear enough...is that I
need to parse row one into columns and the fields in row 2 don't match up the
same as row one. Essentially i need to split all odd cells into one fixed
length spreadsheet and all even cells into a different fixed length
spreadsheet.

"bj" wrote:

I think you will need to impert them into one sheet.
then you can select only even rows through many methods
helper column with =mod(row(),2)+1
select the helper column copy and paste special values
select all and sort by helper column
select all the rows with 2 in the helper column and cut and paste into sheet 2


"MikeD1224" wrote:

I have a .txt file that I need to import into Excel as fixed length. I need
to import all the odd rows from the .txt file into worksheet 1 and then
import all the even rows from the .txt file into worksheet 2.

Any ideas on how I would do this?

Thanks,

Mike


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Import only certain rows from text file

I will try that....is this something that a macro could be written for. The
file varies in length each time but that shouldn't make a big difference.

"Dave Peterson" wrote:

How about importing all the data into one worksheet in one column (column A).

Then insert a new column A and insert that formula into it.

Then you can convert those formulas to values, and sort by that column.

Then cut the bottom half (of column B) and put it A1 of a new worksheet. And
use Data|Text to columns to parse that the way you want.

And then on the original worksheet, delete that helper column A and use
data|Text to columns to parse that the way you want.


MikeD1224 wrote:

The only problem with that...and maybe I was not clear enough...is that I
need to parse row one into columns and the fields in row 2 don't match up the
same as row one. Essentially i need to split all odd cells into one fixed
length spreadsheet and all even cells into a different fixed length
spreadsheet.

"bj" wrote:

I think you will need to impert them into one sheet.
then you can select only even rows through many methods
helper column with =mod(row(),2)+1
select the helper column copy and paste special values
select all and sort by helper column
select all the rows with 2 in the helper column and cut and paste into sheet 2


"MikeD1224" wrote:

I have a .txt file that I need to import into Excel as fixed length. I need
to import all the odd rows from the .txt file into worksheet 1 and then
import all the even rows from the .txt file into worksheet 2.

Any ideas on how I would do this?

Thanks,

Mike


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Import only certain rows from text file

Sure.

You may even want to record a macro when you do it once.

It might be code that even works!!!

MikeD1224 wrote:

I will try that....is this something that a macro could be written for. The
file varies in length each time but that shouldn't make a big difference.

"Dave Peterson" wrote:

How about importing all the data into one worksheet in one column (column A).

Then insert a new column A and insert that formula into it.

Then you can convert those formulas to values, and sort by that column.

Then cut the bottom half (of column B) and put it A1 of a new worksheet. And
use Data|Text to columns to parse that the way you want.

And then on the original worksheet, delete that helper column A and use
data|Text to columns to parse that the way you want.


MikeD1224 wrote:

The only problem with that...and maybe I was not clear enough...is that I
need to parse row one into columns and the fields in row 2 don't match up the
same as row one. Essentially i need to split all odd cells into one fixed
length spreadsheet and all even cells into a different fixed length
spreadsheet.

"bj" wrote:

I think you will need to impert them into one sheet.
then you can select only even rows through many methods
helper column with =mod(row(),2)+1
select the helper column copy and paste special values
select all and sort by helper column
select all the rows with 2 in the helper column and cut and paste into sheet 2


"MikeD1224" wrote:

I have a .txt file that I need to import into Excel as fixed length. I need
to import all the odd rows from the .txt file into worksheet 1 and then
import all the even rows from the .txt file into worksheet 2.

Any ideas on how I would do this?

Thanks,

Mike


--

Dave Peterson


--

Dave Peterson
Reply
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
import from text file jason2444 Excel Discussion (Misc queries) 2 January 17th 07 04:22 PM
Would Like to Automate Batch File Creation and Text FIle Import socrtwo Excel Discussion (Misc queries) 2 August 18th 06 03:54 PM
Import txt file with multiple rows for each record VanessaNY Excel Discussion (Misc queries) 4 September 15th 05 07:33 PM
import data from a text file jonny365 Excel Discussion (Misc queries) 0 September 6th 05 03:42 PM
Import only certain rows of a huge text file AriBari Excel Discussion (Misc queries) 4 July 11th 05 06:54 PM


All times are GMT +1. The time now is 12:34 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"