By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,625 Members | 1,448 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,625 IT Pros & Developers. It's quick & easy.

Text File Export

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
"Arno R" <ar****************@tiscali.nl> wrote in message news:<40f514be$0$62354

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

This discussion thread is closed

Replies have been disabled for this discussion.