LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Importing ASCII text into worksheet

I need a program that will read information from an ASCII file, which data is
organized in fixed width. The width of the first column is 8 characters long
and the columns that follow are in width of 16 characters long.

For rows that start with GRID*, the 2nd column needs to be imported into a
worksheet in Excel in column A. For the same row, the data in the 4th column
needs to be imported into the same worksheet into column B and the data in
5th column needs to be imported into the same worksheet in column C.

For rows that start with *, the 2nd column needs to be imported into the
same row above in column D.


The following is some sample data:


$
$ --------------- begin exec section ---------------------------
$
CEND
$
$
$ ---------------- end exec section ---------------------------
$ --------------- begin case control ---------------------------
$
TITLE =
ECHO = NONE
OUTPUT
METHOD = 10
SPC = 1
$
$
$ ---------------- end case control ---------------------------
$ --------------- begin bulk data ---------------------------
$
BEGIN BULK
PARAM,
PARAM,
E
GRID* 11948 02.547415380E+0035.913292032E+002+
* 1.392468901E+003 0 0
GRID* 11949 02.568299386E+0035.823013553E+002+
* 1.404233550E+003 0 0
GRID* 11950 02.560183765E+0036.110349623E+002+
* 1.393538123E+003 0 0
GRID* 11951 02.585286928E+0036.047367958E+002+
* 1.406622591E+003 0 0
GRID* 11952 02.604819484E+0034.976212049E+002+
* 1.437870452E+003 0 0
GRID* 11953 02.587617792E+0035.171256767E+002+
* 1.426662596E+003 0 0
GRID* 11954 02.579635566E+0034.921914698E+002+
* 1.427609606E+003 0 0
GRID* 11955 02.608029258E+0035.197200252E+002+
* 1.435260482E+003 0 0
GRID* 11956 02.509450618E+0031.571528462E+002+
* 1.430737695E+003 0 0
GRID* 11957 02.511725472E+0031.316694151E+002+
* 1.432848509E+003 0 0

The results should be like this:

Column A Column B Column C Column D
11948 2.547415380E+003 5.913292032E+002 1.392468901E+003
11949 2.568299386E+003 5.823013553E+002 1.393538123E+003
etc...


Can anyone help?

 
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
Excel2007 - More columns when importing ascii file? MG Excel Discussion (Misc queries) 2 July 18th 07 05:44 PM
Importing Ascii file to Excell won't include Null Characters KJM Excel Discussion (Misc queries) 0 September 19th 06 09:03 PM
importing ASCII tt Excel Discussion (Misc queries) 1 March 3rd 06 03:29 AM
Importing to Excel from ASCII Currie Excel Discussion (Misc queries) 5 August 26th 05 10:46 PM
Excel 2000 importing huge ASCII files into different sheets Goran Stjepanovic Excel Programming 2 February 25th 04 09:30 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"