Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Parsing imported text file with macro... help!

I know this is a "redundant post" but the topic description i had befor
wasn't very true to the subject.. and i deleted the other post

Using Excel 2000 9.0.3821 SR-1

So ive got this text file that is dumped from our reports server an
unfortunatly it isnt csv... so i've imported it, set columns an
created a new sheet for the data to pull to... however the data i wan
(theres 3 rows per job) skips every 6 rows... i tried using an offse
and then dragging it, but when i do that, it still increments by one..
also, due to pagination this set of 6 rows happens 7 times(7 jobs pe
page), then skips 30 rows and starts over... so:

Row1-Data
Row2-Data
Row3-Data
Row4-Skip
Row5-Skip
Row7-Data
Row8-Data
Row9-Data
Row10-Skip
Row11-Skip

and so on for 7 occurances, then the diff between the next set of
data rows during pagination is 30....

The data also comes from multiple columns...

For Instance my results sheet is 18 columns wide...
Results Imported
Col1 = A1
Col2 = D1&E1&F1
Col3-10 = C2:J2
Col11-18 = C3:J3

This represents one job in one row in the results file

any ideas? i can post images of the imported text file with highlite
contents desired and an image of the destination sheet if that helps a
all...

i dont know any marco coding but this is kinda whats needs to happen

<Macro
//Easy macroing I can perform
Open Text Tile
Set the fixed column widths
Rename sheet containing text file to "closed"
Open new sheet
add headings to columns in new sheet

//Where the macro prolly needs hand coding
//I don't know how to convert this conceptual code into VBA

//The number of rows in column A of imported text file
$numrows=#rows in col A in sheetname"closed" - 6 rows from where a cel
in column A contains the word(corporate);

//row to start parsing from in imported file
$startrow=row# from sheetname"closed";

//row number to start adding data to in the new sheet
$currentrow=5;

//parse range
for (row=1,1<=$numrows,rows++)
{
//data copy from startrow
for (i=0,i<6,i++)
{
$data=($startrow+(6*i)):data

//increment currentrow
currentrow= currentrow+1;
}

//skips the next 30 rows due to pagination and
//goes back to the 6 row skip
for (skip=1,rows<30,i++)
{
skip these 30 blank rows
}

//increment currentrow
currentrow=currentrow+1;
}
</Macro

something like that... i think might wor

--
Message posted from http://www.ExcelForum.com

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
can I display the file name of the imported text file in another c John-G Excel Discussion (Misc queries) 0 May 13th 05 03:38 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM
NEED EXCEL MACRO TEXT-PARSING GURU! amywolfie Excel Programming 2 May 18th 04 04:27 PM
NEED EXCEL MACRO TEXT-PARSING GURU! amywolfie Excel Programming 1 May 17th 04 06:14 PM
parsing text file, and generating distinct cell values gerridge Excel Programming 0 April 8th 04 01:46 AM


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