473,395 Members | 1,791 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,395 software developers and data experts.

Eliminate Blank Records from Exported Text file

hi,

Good day. I use Ms Access 2003 to export data from table to TEXTFILE.

this is my Actual output:

EMP003 Matt Dwayne
EMP001 Josh Harnett

EMP005 Peter Parker
EMP006 Flakes Graham
EMP007 Kate Winslett

EMP009 Brittany Murphy
EMP010 Sophia Bush
EMP002 Jake Connor

EMP003 Bruce Wayne
EMP004 Mac Donalds



And this is my Desired output:
EMP003 Matt Dwayne
EMP001 Josh Harnett
EMP005 Peter Parker
EMP006 Flakes Graham
EMP007 Kate Winslett
EMP009 Brittany Murphy
EMP010 Sophia Bush
EMP002 Jake Connor
EMP003 Bruce Wayne
EMP004 Mac Donalds

How do I eliminate the blank spaces between in textfile.

Thank you!!!
Jul 3 '08 #1
10 3375
FishVal
2,653 Expert 2GB
Hi, there.

You should provide more information:
  • How do you perform export?
  • Relevant dataset(s) metadata. Here is an example of how to post table MetaData :
    Table Name=tblStudent
    Expand|Select|Wrap|Line Numbers
    1. Field; Type; IndexInfo
    2. StudentID; AutoNumber; PK
    3. Family; String; FK
    4. Name; String
    5. University; String; FK
    6. Mark; Numeric
    7. LastAttendance; Date/Time

Regards,
Fish
Jul 3 '08 #2
NeoPa
32,556 Expert Mod 16PB
Instead of exporting the table directly, create a Query which filters out empty lines. Export this query instead of the table.
Jul 4 '08 #3
Instead of exporting the table directly, create a Query which filters out empty lines. Export this query instead of the table.



Hi,

I generate output thru using the Send report to a file using the Command button wizard. I am using a button to export a report.


How do I create a query that empty lines. Can elaborate on this.

Thanks
Jul 16 '08 #4
NeoPa
32,556 Expert Mod 16PB
I can try, but I need a feeling for what you're already familiar with.

A. Do you have a query that the report runs from?
B. What do you know about queries already?

You should understand that queries only do base data - no totals or anything or even running totals.
Jul 16 '08 #5
I can try, but I need a feeling for what you're already familiar with.

A. Do you have a query that the report runs from?
B. What do you know about queries already?

You should understand that queries only do base data - no totals or anything or even running totals.


Hi thanks for your time.

I have a query that displays what I need. Its just that there are spaces between.
My query is very basic. It selects the fields that I want to generate. I use the Output to function in Command Button. I can also use macro to export textfile from an existing Report.

and the textfiles appears like these:


00000001 1 DIRF
00000002 1 DIRF

00000003 1 DIRF
00000004 1 DIRF
00000005 1 DIRF

00000006 1 DIRF
00000007 1 DIRF
00000008 1 DIRF


Thank you for helping me.
Jul 17 '08 #6
NeoPa
32,556 Expert Mod 16PB
Let's take the focus away from the report for the moment.

I need to know a bit about the query (what is its name and what is the SQL code for it)?

When run natively (again not the report - just running the query) does it include any blank lines then?
Jul 17 '08 #7
Let's take the focus away from the report for the moment.

I need to know a bit about the query (what is its name and what is the SQL code for it)?

When run natively (again not the report - just running the query) does it include any blank lines then?

Hi there,

I created a table named RT1_Declarant_ Information_1_TBL
I created fields in this table. Then I made a query.
The query's name is Query1. I created an Expr1 field in the query to concatenate all the fields and put it in 1 field which is Expr1

sql view of query:
SELECT [SEQ_NUM] & [TYPE] & [DECLARANTS] & [FILENAME] & [CALENDAR_YR] & [O/R] & [DECLARATION_STATUS] & [NAME_BUSNAME_DEC] AS Expr1
FROM [RT1_Declarant_ Information_1];


If I run the concatenated query Expr1: [SEQ_NUM] & [TYPE] & [DECLARANTS] & [FILENAME] & [CALENDAR_YR] & [O/R] & [DECLARATION_STATUS] & [NAME_BUSNAME_DEC]


and export it in Export Text wizard as text, with delimited, Other: | (pipeline)
and Text qualifier as none>next>finish

I can get the desired output without quotes. But this is a very long process for a user.....

If I try to use Query1 to make a Report. The Output appears like this:


00000004100023569995DIRF2008R1131200811SMITH,JULES
00000005145467623417979DIRF2008O2100200811WAYNE,BR UCE
00000006100087844554DIRF2008O2111200811ANDREWS,REN EE

00000007178797998989945DIRF2008O1120200801ALLEN,MA RK
00000008100098989255DIRF2008O1131200811OWEN,HALLE
00000009147232645666665DIRF2008O1100200811MOONIE,I AN

00000010100059855685DIRF2008O1111200811CASTILLO,MA NUEL
00000011158956563365886DIRF2006R1220200810AMANTE,P OPE
00000012115487875215457DIRF2002R1231200810SALTA,NE IL



Is there a macro that can output textfile from a query without quotes so I can just use a macro in a Command button.

I would like to export data from an existing concatenated query Expr1 to an output textfle without spaces..

Thanks again. :)
Jul 18 '08 #8
NeoPa
32,556 Expert Mod 16PB
Ah, now we have something a little more solid to work with. Well done.

Try :
Expand|Select|Wrap|Line Numbers
  1. SELECT [SEQ_NUM] &
  2.        [TYPE] &
  3.        [DECLARANTS] &
  4.        [FILENAME] &
  5.        [CALENDAR_YR] &
  6.        [O/R] &
  7.        [DECLARATION_STATUS] &
  8.        [NAME_BUSNAME_DEC] AS Expr1
  9. FROM [RT1_Declarant_ Information_1]
  10. WHERE [SEQ_NUM] &
  11.       [TYPE] &
  12.       [DECLARANTS] &
  13.       [FILENAME] &
  14.       [CALENDAR_YR] &
  15.       [O/R] &
  16.       [DECLARATION_STATUS] &
  17.       [NAME_BUSNAME_DEC]=''
This may well work better for your report too (depending on exactly what you need in it).

A query (QueryDef) with this SQL can be exported from within Access.
Jul 18 '08 #9
Hi thanks for your time, however, the code that you gave me outputs a blank query. Am I missing something?
Jul 21 '08 #10
NeoPa
32,556 Expert Mod 16PB
Ah, now we have something a little more solid to work with. Well done.

Try :
Expand|Select|Wrap|Line Numbers
  1. SELECT [SEQ_NUM] &
  2.        [TYPE] &
  3.        [DECLARANTS] &
  4.        [FILENAME] &
  5.        [CALENDAR_YR] &
  6.        [O/R] &
  7.        [DECLARATION_STATUS] &
  8.        [NAME_BUSNAME_DEC] AS Expr1
  9. FROM [RT1_Declarant_ Information_1]
  10. WHERE [SEQ_NUM] &
  11.       [TYPE] &
  12.       [DECLARANTS] &
  13.       [FILENAME] &
  14.       [CALENDAR_YR] &
  15.       [O/R] &
  16.       [DECLARATION_STATUS] &
  17.       [NAME_BUSNAME_DEC]=''
This may well work better for your report too (depending on exactly what you need in it).

A query (QueryDef) with this SQL can be exported from within Access.
Probably not.

I don't have direct access to your database so can't check how various fields are set up. Try changing the [=''] in line 17 to [ Is Null] instead :
Expand|Select|Wrap|Line Numbers
  1. [NAME_BUSNAME_DEC] Is Null
Jul 26 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ruben | last post by:
Hello. I am trying to read a small text file using the readline statement. I can only read the first 2 records from the file. It stops at the blank lines or at lines with only spaces. I have a...
0
by: Luke Airig | last post by:
I am trying to merge two xml files based on common date/time and then write out a tab-delimited xml file with the header record from one of the input files concatenated in front of the merged...
10
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions,...
1
by: satya.mahesh | last post by:
Hi All, I am working on a problem which "eliminates blank lines in export (between headings and when a heading is empty)". I want a macro which will do this job for me. For e.g: Heading1 ...
0
by: erucevice | last post by:
I am trying to bcp a text file that is written out of a Java application. The text file has important order information that I need to bcp into a SQL Server 2000 database. The problem is that when...
6
by: EricR | last post by:
I am trying to bcp import a text file into a SQL Server 2000 database. The text file is coming out of a java application where order information is written to the text file. Each record is on it's...
1
by: galewind | last post by:
Hi, I have exported a report to text file using the Outputto action in a macro. There is no problem in the format in the text file except that there is a blank line every 2/3 records. How to remove...
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...
6
by: ladybug76 | last post by:
Hello. I'm working in Access 2003 and I'm new to VBA. I'm trying to create a button on a form that will run my query (based on the 2 drop down box parameter selections made by the user). The...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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,...

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.