Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Searching a txt file for splitting into different worksheets

Is it possible to write code that will take a 100 page txt file that has
several different fixed width sections and send them to different
worksheets. The Text file looks something like this:



Report for 1-19-2004
Section A
xxx xxxx xx xxxxxx xxxx xxxxxx xxx
xxx xxxx xx xxxxxx xxxx xxxxxx xxx
xxx xxxx xx xxxxxx xxxx xxxxxx xxx
end of section

Report for 1-19-2004
Section B
xxxxxx xxxx xxxx xxxxxxxxxx
xxxxxx xxxx xxxx xxxxxxxxxx
xxxxxx xxxx xxxx xxxxxxxxxx
xxxxxx xxxx xxxx xxxxxxxxxx
end of section

Report for 1-19-2004
Section C
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
page break

Report for 1-19-2004
Section C
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
end of section


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Searching a txt file for splitting into different worksheets

Yes, you would just look for the word Section in the line you read in to
separate the sections.

You would want to do a sequential read:

http://support.microsoft.com/support...eio/fileio.asp
File Access with Visual Basic® for Applications


--
Regards,
Tom Ogilvy

"Randy Reese" wrote in message
ink.net...
Is it possible to write code that will take a 100 page txt file that has
several different fixed width sections and send them to different
worksheets. The Text file looks something like this:



Report for 1-19-2004
Section A
xxx xxxx xx xxxxxx xxxx xxxxxx xxx
xxx xxxx xx xxxxxx xxxx xxxxxx xxx
xxx xxxx xx xxxxxx xxxx xxxxxx xxx
end of section

Report for 1-19-2004
Section B
xxxxxx xxxx xxxx xxxxxxxxxx
xxxxxx xxxx xxxx xxxxxxxxxx
xxxxxx xxxx xxxx xxxxxxxxxx
xxxxxx xxxx xxxx xxxxxxxxxx
end of section

Report for 1-19-2004
Section C
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
page break

Report for 1-19-2004
Section C
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
xxx xxx xxx xxxxxx xxxx xxxxxxx xxx xxx
end of section




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
SPLITTING DATA INTO NEW WORKSHEETS FROM ONE WORKSHEET Romeo Excel Discussion (Misc queries) 3 November 21st 08 05:01 PM
splitting a worksheet into multiple worksheets levine52 Excel Discussion (Misc queries) 1 November 5th 08 03:03 PM
Splitting a text file into individual worksheets Sam Chambers[_2_] Excel Discussion (Misc queries) 7 June 8th 07 05:10 PM
splitting data across worksheets newshoes Excel Discussion (Misc queries) 3 November 13th 06 05:19 PM
Searching Across Worksheets: Please help! computerfineman New Users to Excel 4 August 19th 06 05:03 AM


All times are GMT +1. The time now is 01:22 AM.

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"