SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old August 18th, 2004, 10:33 AM
Lehane Lehane is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: South Africa
Posts: 6 Lehane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Lehane Send a message via MSN to Lehane Send a message via Yahoo to Lehane
Exclamation I need Code to clean up and format textfile and output it into a Excel spreadsheet

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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > I need Code to clean up and format textfile and output it into a Excel spreadsheet


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway