Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 formatting text file
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
r0ssar00




PostPosted: Fri Sep 01, 2006 12:16 pm   Post subject: formatting text file

i have a text file which has many many lines, but these lines have a specific format to them, each text section may contain anything except $ and #, which means spaces may be included
code:

$some text#sometext#sometext#w329084701928347109283471234701923847109283

but the problem is, the last section after the last # can extend to multiple lines, i need a piece of code that will read through the file and have each line that starts with $ on its own line with all of the data for that item on the same line
so given the data
code:

$sometext#sometext#sometext#w3290847019283471092834712347019238471092832198743912714092
1702398471092837410982374091827304981723098471092387410982374091837204981723098471098237491823
813704982739841709238741982374019832740918237401982734917

$more text#moretext#evenmoretext#984741098237409182374019823740198237409817398147239874109823740198723409812734981702943

$lasttext#text#text#0894719382470192834701923847019823750198237401982374098123740981723409
41982734981073298471098234709182374098170329847198237409812374908173409710923847189324


it should look like this
code:

$sometext#sometext#sometext#w32908470192834710928347123470192384710928321987439127140921702398471092837410982374091827304981723098471092387410982374091837204981723098471098237491823813704982739841709238741982374019832740918237401982734917

$more text#moretext#evenmoretext#984741098237409182374019823740198237409817398147239874109823740198723409812734981702943

$lasttext#text#text#089471938247019283470192384701982375019823740198237409812374098172340941982734981073298471098234709182374098170329847198237409812374908173409710923847189324

each line beginning with $ is one line, everything that follows until the next $ is part of the same line
Sponsor
Sponsor
Sponsor
sponsor
r0ssar00




PostPosted: Fri Sep 01, 2006 12:18 pm   Post subject: (No subject)

forgot to mention one thing, where it says "it should look like this" i mean the final result when run through the algorithm
the code should output to file
thanks
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: