473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to write a continuous line in a text file?

Hello,

I need to write a continuous line (without CR-LF) in VBA into a text file.
I tried opening the file as binary and used the "put" command but it inserts
the data type and length before the actual data. Is there a way to do this
in Access? Thanks in advance.

Jay
Jan 24 '07 #1
2 4600
build the string in your loop and then use "Write" when you're all done
to output it.

dim strA as string
open filename for output as #1
strA = ""
do while not done
strA = strA & thenextpiece
loop
write #1, strA
close #1

On Jan 24, 9:58 am, "Jay S." <j...@noemail.c omwrote:
Hello,

I need to write a continuous line (without CR-LF) in VBA into a text file.
I tried opening the file as binary and used the "put" command but it inserts
the data type and length before the actual data. Is there a way to do this
in Access? Thanks in advance.

Jay
Jan 24 '07 #2
Thanks for your reply. I figured it out. I created a fixed 80 char string
and used "put" for every record. It didn't include the 2-byte var info
since it was a fixed length string. I didn't use "write" the way you did
because the line can go on for a while and there's a limit to a variable
string length (IIRC). Thanks again though.

Jay

"Jason Lepack" <jl*****@gmail. comwrote in message
news:11******** **************@ v45g2000cwv.goo glegroups.com.. .
build the string in your loop and then use "Write" when you're all done
to output it.

dim strA as string
open filename for output as #1
strA = ""
do while not done
strA = strA & thenextpiece
loop
write #1, strA
close #1

On Jan 24, 9:58 am, "Jay S." <j...@noemail.c omwrote:
Hello,

I need to write a continuous line (without CR-LF) in VBA into a text
file.
I tried opening the file as binary and used the "put" command but it
inserts
the data type and length before the actual data. Is there a way to do
this
in Access? Thanks in advance.

Jay

Jan 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1512
by: Marty | last post by:
Hi everybody, Is it possible to do that in VB.NET: I have a text file that is filled with new lines of text every n seconds. This text file get very massive. I want to have my program to monitor this text file and to be able to read only the new added line when it detect that a new line has been added. I don't want to read the whole file every time, this would be high time consuming.
3
2667
by: John Flynn | last post by:
hi, having problems reading from and writing back to the same file. basically, i want to read lines of text from a file and reverse them and write them back to the same file.. it has to replace the text its reversing eg.
5
2207
by: Armando | last post by:
I recently saw the tail end of a "Continuous forms" discussion, but not enough was available to see if this will be a PITA repeat question. Sorry if it is. On a form with its Default View set to Continuous Forms, I need to catch the event when the repeating section iterates for each record in the underlying table. I have buttons on the repeating section which will get their captions from the current line in the table, or which will...
1
4308
by: Magix | last post by:
Hi, I have these string data: str_data1, str_data2, str_data3, which capture some value after a routine process A. Then I would like to write (append) these 3 string values into a text file each time after routine process A, the text file is named "mytext.dat" in following format with "#####" as separator. The maximum entries of them is 5. When reaching the fifth entry, it will delete the very first entry.
11
3564
by: Doug Bell | last post by:
Hi, I am trying to create form that displays data like an Access continuous dataform rather than using a data grid. I am thinking that I can achieve this by creating a row of text boxes, one for each field I need to display. The creating a controls array for the first n records I show and populate the text boxes. Then setting up a vertical scroll bar for the number of records in the data table. As the scroll bar is clicked or dragged,...
12
11122
by: Nina | last post by:
Hi there, What is the maximum length that one line can hold in a text file using StreamWriter's Write or WriteLine method? If the string is too long for one line to hold, what will Write or WriteLine do? In order me to retrieve data correctly from the text file later, I have to know the right index. For the following code,if str1's length exceeds one line in text file, how can I get str2's index when reading the text file? Is there...
8
7518
by: JohnDoe528 | last post by:
Using Access 2000 on XP, I have a continuous subform that lists the different licenses attributed to a person selected (current record of the main form). This is what each line of the sub form looks like: __________________________________________________________________ License Name: : Names License Key: : Key License Active:
6
18300
by: globalrev | last post by:
i ahve a program that takes certain textsnippets out of one file and inserts them into another. problem is it jsut overwrites the first riow every time. i want to insert every new piece of text into the next row. so: 1. how do i write to a new line every time i write to the file? 2. if i dont want to write to a new line but just want to insert it
3
1988
by: AdamOnAccess | last post by:
This is something I've always had trouble with, and it comes up fairly frequently... I have a continous form with a single text field and next to this text field, I have a caption that maintains the number of characters the user can type into the text field before they reach maximum (the number decreases with every key stroke). It looks like this: Text In Field Here 18 I use this function to keep count of the characters remaining...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6800
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.