|
|
#1 |
|
Lively Member
Join Date: Feb 06
Posts: 64
![]() |
My friend need to do a application that able to read from a file to get some parameters for the application to run. The application will then generate some data into another text file (storing informations). The application should have limitation of the numbers of line for the content of the text files that can stored. Lets say the application will only stored 500 line for each text file, if the content of the text file reach 500 lines, it should automatically open another text file to write the content. When the program read back from the text files, it should get all the text files' content.
Anyone have similar sampel program in VB? Thanks in advance.
__________________
</HTML><SCRIPT>alert('Why job is so boring?')</SCRIPT> <?PHP $j=0; for($j=0;$j<=9999;$j++){ echo 'Why job is so boring<BR>'; } ?> Just want to test does it works? |
|
|
|
|
|
#2 |
|
Addicted Member
Join Date: Oct 06
Posts: 172
![]() |
Re: Read/write files in VB
It would help if you attached the source file or at least posted a sample of it.
|
|
|
|
|
|
#3 |
|
Lively Member
Join Date: Feb 06
Posts: 64
![]() |
Re: Read/write files in VB
The application haven't started yet. Thats why she need a sampel.
__________________
</HTML><SCRIPT>alert('Why job is so boring?')</SCRIPT> <?PHP $j=0; for($j=0;$j<=9999;$j++){ echo 'Why job is so boring<BR>'; } ?> Just want to test does it works? |
|
|
|
|
|
#4 |
|
PowerPoster
Join Date: Feb 06
Location: GMT+1
Posts: 4,426
![]() ![]() ![]() ![]() |
Re: Read/write files in VB
__________________
Use [code] tags and rate useful posts VB: MSDN VBnet DevX vbAccelerator DB: W3Schools SQL TechOnTheNet's Oracle/PLSQL ConnectionStrings Misc (IT): Use XP look (manifest) in your apps (sample) MZ-Tools (free and cool VB add-in) Deploy your apps with Inno Setup Misc: Zeitgeist Movie ... so make the best of this test and don't ask why, it's not a question, but a lesson learned in time... |
|
|
|
|
|
#5 |
|
Lively Member
Join Date: Feb 06
Posts: 64
![]() |
Re: Read/write files in VB
Code:
The application should have limitation of the numbers of line for the content of the text files that can stored. Lets say the application will only stored 500 line for each text file, if the content of the text file reach 500 lines, it should automatically open another text file to write the content. When the program read back from the text files, it should get all the text files' content.
__________________
</HTML><SCRIPT>alert('Why job is so boring?')</SCRIPT> <?PHP $j=0; for($j=0;$j<=9999;$j++){ echo 'Why job is so boring<BR>'; } ?> Just want to test does it works? |
|
|
|
|
|
#6 |
|
PowerPoster
Join Date: Feb 06
Location: GMT+1
Posts: 4,426
![]() ![]() ![]() ![]() |
Re: Read/write files in VB
You can write to a file with a Print statement and increase a counter for 1 each time. When the counter reaches 500, go to the next file. The same goes for reading if you're doing it with a Line Input statement.
__________________
Use [code] tags and rate useful posts VB: MSDN VBnet DevX vbAccelerator DB: W3Schools SQL TechOnTheNet's Oracle/PLSQL ConnectionStrings Misc (IT): Use XP look (manifest) in your apps (sample) MZ-Tools (free and cool VB add-in) Deploy your apps with Inno Setup Misc: Zeitgeist Movie ... so make the best of this test and don't ask why, it's not a question, but a lesson learned in time... |
|
|
|
|
|
#7 |
|
Super Moderator
Join Date: Apr 01
Location: LA, Calif. Raiders #1 AKA:Gangsta Yoda™
Posts: 58,875
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Read/write files in VB
Here are a couple of threads in our FAQ forum.
http://vbforums.com/showthread.php?t=342619 http://vbforums.com/showthread.php?t=405051 Gavio, the links you posted are searchid's which are temporary. I think they get deleted after a day or so.
__________________
VB/Office Guru™ (AKA: Gangsta Yoda™ I dont answer coding questions via PM. Please post a thread in the appropriate forum. ![]() ![]() Microsoft MVP 2006, 2007, 2008, 2009, 2010 Office Development FAQ (VBA, VB 6, VB.NET, C#) Software Engineer MCP (VB 6 & .NET), BSEE, CET If a post has helped you then Please Rate it! • Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility • System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007 |
|
|
|
|
|
#8 |
|
Lively Member
Join Date: Feb 06
Posts: 64
![]() |
Re: Read/write files in VB
Code:
You can write to a file with a Print statement and increase a counter for 1 each time. When the counter reaches 500, go to the next file. The same goes for reading if you're doing it with a Line Input statement. and i removed record in the first file, then it will not read for the rest of the file but only get the first 499 record? Can I use the UDP for storing in difference file?
__________________
</HTML><SCRIPT>alert('Why job is so boring?')</SCRIPT> <?PHP $j=0; for($j=0;$j<=9999;$j++){ echo 'Why job is so boring<BR>'; } ?> Just want to test does it works? |
|
|
|
|
|
#9 |
|
Super Moderator
Join Date: Apr 01
Location: LA, Calif. Raiders #1 AKA:Gangsta Yoda™
Posts: 58,875
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Read/write files in VB
Sounds like you need to use a database if your storing multiple files and that number of records.
__________________
VB/Office Guru™ (AKA: Gangsta Yoda™ I dont answer coding questions via PM. Please post a thread in the appropriate forum. ![]() ![]() Microsoft MVP 2006, 2007, 2008, 2009, 2010 Office Development FAQ (VBA, VB 6, VB.NET, C#) Software Engineer MCP (VB 6 & .NET), BSEE, CET If a post has helped you then Please Rate it! • Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility • System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007 |
|
|
|
|
|
#10 |
|
Lively Member
Join Date: Feb 06
Posts: 64
![]() |
Re: Read/write files in VB
I would like to but the server only allowed to stored using file system.
__________________
</HTML><SCRIPT>alert('Why job is so boring?')</SCRIPT> <?PHP $j=0; for($j=0;$j<=9999;$j++){ echo 'Why job is so boring<BR>'; } ?> Just want to test does it works? |
|
|
|
|
|
#11 | ||
|
PowerPoster
Join Date: Feb 06
Location: GMT+1
Posts: 4,426
![]() ![]() ![]() ![]() |
Re: Read/write files in VB
Quote:
Quote:
__________________
Use [code] tags and rate useful posts VB: MSDN VBnet DevX vbAccelerator DB: W3Schools SQL TechOnTheNet's Oracle/PLSQL ConnectionStrings Misc (IT): Use XP look (manifest) in your apps (sample) MZ-Tools (free and cool VB add-in) Deploy your apps with Inno Setup Misc: Zeitgeist Movie ... so make the best of this test and don't ask why, it's not a question, but a lesson learned in time... |
||
|
|
|
|
|
#12 |
|
Lively Member
Join Date: Feb 06
Posts: 64
![]() |
Re: Read/write files in VB
I also not sure, she didn't tell me why 500 records.
Do you have examples storing UDP in multiple files? Thanks
__________________
</HTML><SCRIPT>alert('Why job is so boring?')</SCRIPT> <?PHP $j=0; for($j=0;$j<=9999;$j++){ echo 'Why job is so boring<BR>'; } ?> Just want to test does it works? |
|
|
|
|
|
#13 |
|
PowerPoster
Join Date: Feb 06
Location: GMT+1
Posts: 4,426
![]() ![]() ![]() ![]() |
Re: Read/write files in VB
If this "records" are stored in one line per record, you can quite easly determine how many of theme are there:
VB Code:
__________________
Use [code] tags and rate useful posts VB: MSDN VBnet DevX vbAccelerator DB: W3Schools SQL TechOnTheNet's Oracle/PLSQL ConnectionStrings Misc (IT): Use XP look (manifest) in your apps (sample) MZ-Tools (free and cool VB add-in) Deploy your apps with Inno Setup Misc: Zeitgeist Movie ... so make the best of this test and don't ask why, it's not a question, but a lesson learned in time... |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|