|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Hi im trying to clean up and format a textfile that contains data as shown below and write the result to an Excel spreadsheet:
006252721954103167 2002090100000000N 045562081973091467 2002020100000000N 045800521973030667 2002031300000000N 116915141950110967T1996040100000000N 116915491956031367T1996040100000000N 116915571959042167T1996040100000000N 904323631954031467T2004012120040331N 904376671976070667T2004010120040331N 904382721975040267T2004010120040331N 905005041946062667 0000000000000000N 905005211967020567 0000000000000000N 905005391951062667 0000000000000000N This is what needs to be done: * Each line consists of 36 characters * These lines need to be divided into columns(cells) as follows: cell 1 = char 1-8 , cell 2 = char 9-16 , cell 3 = char 17-18 , cell 4 = char 19 , cell 5 = char 20-27 , cell 6 = char 28-35 , cell 7 = char 36. Cell 1 and 3 is fine as is. Cell 4 can contain a 'T' or be NULL. Cell 2,5 and 6 are containing dates in format YYYYMMDD eg. 20030423 . I need it to look like this YYYY\MM\DD eg. 2003\04\23 If Cell 5 contains only zeroes,then it should insert default value of 20001201.(this should also be formatted as above) If Cell 6 contains only zeroes,then it should insert default value of " " or it can be NULL. Cell 7 cannot be NULL and should contain only a 'N" or 'Y' if it is NULL it should put a 'N' to the cell. The result must be in a Excel spreadsheet. Im working with hundreds of thousands of records, and Excel only allows 60 000 records per file. Therefor i need to break the resulting file every 60 000 records and create another resulting file containing the rest of the records till there is no more. Can you please help, this is very urgent! Im using Visual Basic at the moment. This is a doozy for me and im still new at this...If anyone knows of an easier way to this please let me know... PS: I can't use Excel formatting in this file because the program that uses the result files does not recognise the fields. Thanx in advance! L Last edited by Lehane : August 18th, 2004 at 10:41 AM. Reason: Checking Thread Subscription |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > I need Code to clean up and format textfile and output it into a Excel spreadsheet |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|