Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can I display the file name of the imported text file in another c | Excel Discussion (Misc queries) | |||
VBA Import of text file & Array parsing of that data | Excel Discussion (Misc queries) | |||
NEED EXCEL MACRO TEXT-PARSING GURU! | Excel Programming | |||
NEED EXCEL MACRO TEXT-PARSING GURU! | Excel Programming | |||
parsing text file, and generating distinct cell values | Excel Programming |