473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Text File Export

Hello,

Thanks in advance for any help offered.....

I have a routine which exports a 4 field query into a text file. The 4
fields are inverted and end up as rows in the text file.

eg query data: 1 2 3 4
file data 1
2
3
4

What I now need to do is pass through the file and after every 100
lines insert 4 blank lines! i.e at line 100 insert 4 blank lines so
the original line at 101 is now starting at 105, go another 100 lines
and insert 4 blanks after line 204 etc....

I have been successful with the first part but I have to insert the 4
blank lines manually!

Can someone suggest a method or routine which could do this for me.

Thanks again....
Nov 13 '05 #1
2 1610
Osmethod,

I guess you are exporting with code like

< DimCodeHere >
Do until rstExport.EOF
ExportThe4Fields
rstExport.MoveNext
Loop
<CloseAndExitcodeHere>

Just add a counter in your routine and your code would look like
< DimCodeHere >
Dim lngCounter as long
Do until rstExport.EOF
If lngCounter =100 then
Create4BlankRows
lngCounter=0
end if
ExportThe4Fields
lngCounter =lngCounter +4
rstExport.MoveNext
Loop
<CloseAndExitcodeHere>

You will have to adapt this example of course but you will get the idea

--
Hope this helps
Arno R
"osmethod" <os******@eircom.net> schreef in bericht
news:9c**************************@posting.google.c om...
Hello,

Thanks in advance for any help offered.....

I have a routine which exports a 4 field query into a text file. The 4
fields are inverted and end up as rows in the text file.

eg query data: 1 2 3 4
file data 1
2
3
4

What I now need to do is pass through the file and after every 100
lines insert 4 blank lines! i.e at line 100 insert 4 blank lines so
the original line at 101 is now starting at 105, go another 100 lines
and insert 4 blanks after line 204 etc....

I have been successful with the first part but I have to insert the 4
blank lines manually!

Can someone suggest a method or routine which could do this for me.

Thanks again....

Nov 13 '05 #2
"Arno R" <ar****************@tiscali.nl> wrote in message news:<40f514be$0$62354

Thanks a million... just what I needed.
Nov 13 '05 #3

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

Similar topics

12
by: alessia | last post by:
hi, I have a query that visualizes me, according to some criterions from me inserted, name , Surname , Address , phone ok.. Now, through a button, positioned in a Form, I have to only export...
11
by: scorpion53061 | last post by:
Well I had a way to write an array to an excel spreadsheet but on a huge time critical run it failed iwth the dreaded HRESULT: 0x800A03EC error. It worked fine when i sampled the data to go in but...
3
by: Lauren Quantrell | last post by:
I use the code below to generate a text file containing every stored procedure and view in my SQL Server backend database, but I can't figure out how to generate text of the User Defined Functions....
3
by: Daniel Wetzler | last post by:
Dear MSSQL- experts, I have a strange problem with SQLSERVER 2000. I tried to export a table of about 40000 lines into a text file using the Enterprise manager export assitant. I was astonished...
3
by: hbarnett | last post by:
I am in process of converting Access 97 databases to Access 2003. Some of the Access 97 databases export data to a text file with a non standard file extension, such as "ext" or "NAL". When I try...
2
by: Steve Cartnal | last post by:
I need to copy records from several different tables into one text file. Although the tables have many common fields, they also contain several that are different from table to table. I can copy...
9
by: NEWSGROUPS | last post by:
I have data in a table in an Access 2000 database that needs to be exported to a formatted text file. For instance, the first field is an account number that is formatted in the table as text and...
3
by: Wayne | last post by:
I'm trying to automate the export of a query to a text file using code. If I export the query manually I get the exact result that I want i.e. If I select the query then choose File/Export from...
8
by: Irene | last post by:
Hi, I have an MS Access Database with 1 Table containing about 2 million records in Unicode (diferent languages). I would like to export the Table to a Text file (CSV, Tab, etc.) Access...
8
by: iheartvba | last post by:
Hi I am using Access 2007 and am trying to export a query to a fixed length text file. I tried using the following code to export the text file: DoCmd.TransferText acExportFixed, , "qryFFRDeFile",...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.