473,473 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Put Data Into Text File

When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written into the text file.
Is there are character I can concatenate onto the back end of the string I
am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??
Nov 13 '05 #1
8 4794
Michael Wiseley wrote:
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written
into the text
file. Is there are character I can concatenate onto the
back end of
the string I am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??


A new line in Windows is Carriage Return and Line Feed
character pair.

In Access VBA (and VB) concatenate 'vbCrLf' to the end of
your line's worth of text.

--
Nick Coe (UK)
AccHelp v1.01 Access Application Help File Builder
http://www.alphacos.co.uk/
Download Free Copy
----
Nov 13 '05 #2
Or you can use: & vbNewline

*David*

"Nick Coe (UK)" <cl*****************@MASPON.yahooDOTcom> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...
Michael Wiseley wrote:
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written
into the text
file. Is there are character I can concatenate onto the
back end of
the string I am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??


A new line in Windows is Carriage Return and Line Feed
character pair.

In Access VBA (and VB) concatenate 'vbCrLf' to the end of
your line's worth of text.

--
Nick Coe (UK)
AccHelp v1.01 Access Application Help File Builder
http://www.alphacos.co.uk/
Download Free Copy
----

Nov 13 '05 #3
Am I missing something here? I've never used "Put" before.

How about:

Do until rst.eof
Print #filename, , rst!somedata
rst.movenext
Loop

The "Print" will automatically send the CrLf.

Scott
"Michael Wiseley" <mi**********@gte.net> wrote in message
news:xayrd.6727$wr6.1175@trnddc04...
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written into the text
file.
Is there are character I can concatenate onto the back end of the string I
am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??

Nov 13 '05 #4
Thanks. I had never used print before but it works fine. I was trying to use
the put command (after opening a binary type file) to write a string of text
and HTML tags. Then I would rename the file as filename.html.
Using the print statement (and not using binary file type) will make the
HTML code format better when viewing the source code behind the browser.

"Scott Simonson" <sc***********@wi.rr.com> wrote in message
news:rt********************@twister.rdc-kc.rr.com...
Am I missing something here? I've never used "Put" before.

How about:

Do until rst.eof
Print #filename, , rst!somedata
rst.movenext
Loop

The "Print" will automatically send the CrLf.

Scott
"Michael Wiseley" <mi**********@gte.net> wrote in message
news:xayrd.6727$wr6.1175@trnddc04...
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written into the text
file.
Is there are character I can concatenate onto the back end of the string I am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??


Nov 13 '05 #5
I have a newbie question. Using VBA how do I open an INI file and
change the "LastDir=" line, shown below, to a new location then save
the file. I want to do this all in the backgroud before I run a
picture organizer application(from a command button on a form) that
will access the new location in the INI file.

Bottom Width=304
Bottom Height=0
[Main]
HideOnClose=0
LastDir=C:\Pictures\SmithJohn2
LastWorkDir=
LastAction=0
ViewStyle=0
Orientation=0

Thanks in advance.

"Michael Wiseley" <mi**********@gte.net> wrote in message news:<xayrd.6727$wr6.1175@trnddc04>...
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written into the text file.
Is there are character I can concatenate onto the back end of the string I
am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??

Nov 13 '05 #6
This isn't homework, is it?

I would read each line with " Line Input #infile, buff ". Do a "
Search("LastDir=",buff) ". Write out each line to a different file with "
Print #outfile, buff ". Delete the old file and rename the just outputted
file.

HTH

Scott
"bborden" <bb*******@gmail.com> wrote in message
news:ea**************************@posting.google.c om...
I have a newbie question. Using VBA how do I open an INI file and
change the "LastDir=" line, shown below, to a new location then save
the file. I want to do this all in the backgroud before I run a
picture organizer application(from a command button on a form) that
will access the new location in the INI file.

Bottom Width=304
Bottom Height=0
[Main]
HideOnClose=0
LastDir=C:\Pictures\SmithJohn2
LastWorkDir=
LastAction=0
ViewStyle=0
Orientation=0

Thanks in advance.

"Michael Wiseley" <mi**********@gte.net> wrote in message
news:<xayrd.6727$wr6.1175@trnddc04>...
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written into the text
file.
Is there are character I can concatenate onto the back end of the string
I
am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??

Nov 13 '05 #7
An INI file is a bit more than just a text file... there are system INIs and
private INIs, but basically these are "leftovers" from 16-bit Windows.
32-bit Windows uses the Registry for similar purposes -- a great improvement
in the eyes of some, not an improvement at all in the eyes of others. There
are Windows APIs for dealing with INI files, that are preferrable to just
working on them as though they were normal text, although they can be
read/written as normal text files. To learn about the APIs, I'd start
searching at the FAQ site, http://www.mvps.org/access, then if I didn't find
what I was looking for, I'd go to the base URL of http://www.mvps.org and
look for sites offering VB assistance -- one that is very good in such areas
is VB MVP Randy Birch's site. I'd look at http://support.microsoft.com to
search the Knowledge Base and http://office.microsoft.com.

Larry Linson
Microsoft Access MVP

"bborden" <bb*******@gmail.com> wrote in message
news:ea**************************@posting.google.c om...
I have a newbie question. Using VBA how do I open an INI file and
change the "LastDir=" line, shown below, to a new location then save
the file. I want to do this all in the backgroud before I run a
picture organizer application(from a command button on a form) that
will access the new location in the INI file.

Bottom Width=304
Bottom Height=0
[Main]
HideOnClose=0
LastDir=C:\Pictures\SmithJohn2
LastWorkDir=
LastAction=0
ViewStyle=0
Orientation=0

Thanks in advance.

"Michael Wiseley" <mi**********@gte.net> wrote in message

news:<xayrd.6727$wr6.1175@trnddc04>...
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written into the text file. Is there are character I can concatenate onto the back end of the string I am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??

Nov 13 '05 #8

bborden wrote:
I have a newbie question. Using VBA how do I open an INI file and
change the "LastDir=" line, shown below, to a new location then save
the file. I want to do this all in the backgroud before I run a
picture organizer application(from a command button on a form) that
will access the new location in the INI file.

Bottom Width=304
Bottom Height=0
[Main]
HideOnClose=0
LastDir=C:\Pictures\SmithJohn2
LastWorkDir=
LastAction=0
ViewStyle=0
Orientation=0

Thanks in advance.

"Michael Wiseley" <mi**********@gte.net> wrote in message

news:<xayrd.6727$wr6.1175@trnddc04>...
When using

Do until rst.eof
Put #filename, , rst!somedata
rst.movenext
Loop

I would like to create a new line for each item written into the text file. Is there are character I can concatenate onto the back end of the string I am writing to the txt file ?
Or is their a verison of Put that also does NewLine ??


Nov 13 '05 #9

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

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
0
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format....
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
1
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code:...
9
by: a | last post by:
Dear friends I want import data from CSV file to mdb file How can I do that in vb.net?
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
1
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...
0
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...
0
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,...
1
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.