Hi. I am importing a CSV file into a new table using the open file
dialog box and an import specification.
There are four fields (A,B,C,D). I want to filter for duplicates so if
B,C,D are the same then only one of those records will be imported.
Here is an example:
Record 1 (A,B,C,D): John, Mapquest, 59, 62
Record 2 (A,B,C,D): Alex, Mapquest, 62, 81
Record 3 (A,B,C,D): Josh, Finepoint, 43, 65
Record 4 (A,B,C,D): John, Mapquest, 62, 81
Record 5 (A,B,C,D): John, Mapquest, 59, 62
So Record 4 will not be imported, because column B,C,D are the same as
Record 2.
Record 5 will not be imported because B,C,D are the same as Record 1.
I want to ignore column A.
Is this possible? How can I tell VB to do this?
Thanks for your help. Let me know if you don't fully understand what I
want.
|
|
0
|
|
|
|
Reply
|
shmoussa
|
6/14/2007 7:12:38 PM |
|
You are going to need to run a query on the import data to do this, so you
must first either import the data into a temporary table or attach the CSV
file as a linked table.
[Note that it's generally considered a Bad Idea to have temp tables in your
main front-end database. People deal with this in different ways but my
preference is to create temp tables in a temp database and link then in code
to the front-end]
Then you can create a "make table" query based on an aggregate query on your
data, grouping by B, C and D and using the First function to select the
value for A. (Note that the value returned by First is not always
predictable - for example records 2 and 4 could return either Alex or John)
--
Good Luck :-)
Graham Mandeno [Access MVP]
Auckland, New Zealand
"shmoussa" <shmoussa@gmail.com> wrote in message
news:1181848358.843214.298970@e9g2000prf.googlegroups.com...
> Hi. I am importing a CSV file into a new table using the open file
> dialog box and an import specification.
>
> There are four fields (A,B,C,D). I want to filter for duplicates so if
> B,C,D are the same then only one of those records will be imported.
> Here is an example:
>
> Record 1 (A,B,C,D): John, Mapquest, 59, 62
> Record 2 (A,B,C,D): Alex, Mapquest, 62, 81
> Record 3 (A,B,C,D): Josh, Finepoint, 43, 65
> Record 4 (A,B,C,D): John, Mapquest, 62, 81
> Record 5 (A,B,C,D): John, Mapquest, 59, 62
>
> So Record 4 will not be imported, because column B,C,D are the same as
> Record 2.
> Record 5 will not be imported because B,C,D are the same as Record 1.
> I want to ignore column A.
>
> Is this possible? How can I tell VB to do this?
>
> Thanks for your help. Let me know if you don't fully understand what I
> want.
>
|
|
0
|
|
|
|
Reply
|
Graham
|
6/14/2007 11:15:13 PM
|
|
|
1 Replies
469 Views
(page loaded in 0.025 seconds)
Similiar Articles: Filter CSV file for duplicates upon importing - microsoft.public ...Hi. I am importing a CSV file into a new table using the open file dialog box and an import specification. There are four fields (A,B,C,D). I want to filter for ... Filter .csv on import - microsoft.public.accessFilter .csv on import - microsoft.public.access How to import multiple vcard contact files (20 or more) in 1 step ... Filter CSV file for duplicates upon importing ... Reading large csv-file and removing duplicates - microsoft.public ...... updating from a large CSV file can ... update contacts in WLM via csv file? - microsoft.public ... wLM will not read ... Filter CSV file for duplicates upon importing ... Import CSV file into Project with Hard Returns - microsoft.public ...Filter CSV file for duplicates upon importing - microsoft.public ... Import CSV file into Project with Hard Returns - microsoft.public ... Filter .csv on import ... How to update contacts in WLM via csv file? - microsoft.public ...Before I import a csv file, I export a small ... from the originally exported file (you can delete this duplicate after importing). Save, close, and import the new csv ... Import CSV of Users & Move Those Users To A New OU - microsoft ...Filter .csv on import - microsoft.public.access Import CSV of Users & Move Those Users To A New OU - microsoft ... Filter CSV file for duplicates upon importing ... How to import multiple vcard contact files (20 or more) in 1 step ...Filter .csv on import - microsoft.public.access How to import multiple vcard contact files (20 or more) in 1 step ... Filter CSV file for duplicates upon importing ... problems with imported dates - microsoft.public.mac.office.excel ...Filter .csv on import - microsoft.public.access Filter CSV file for duplicates upon importing - microsoft.public ... Date format problems after csv import ... Access Form event doesn't work and crashes Access - microsoft ...access crashing after filter - microsoft.public.access.forms ... ... work either...it also crashes Access. ... access Filter CSV file for duplicates upon importing in ... How can I read CSV file using VBA? - microsoft.public.access ...Help, how do I import a CSV file when Negatives are in Parenthesis ... Filter CSV file ... files (comma-separated values ... ... Reading csv file and parsing comma delimited ... Filter CSV file for duplicates upon importing - microsoft.public ...Hi. I am importing a CSV file into a new table using the open file dialog box and an import specification. There are four fields (A,B,C,D). I want to filter for ... Filter .csv on import - microsoft.public.access | Microsoft NewsgroupsFilter .csv on import - microsoft.public.access How to import multiple vcard contact files (20 or more) in 1 step ... Filter CSV file for duplicates upon importing ... CSV Filter - CodeProjectHow to read, filter and write your CSV files; Author: ... wanted to organize it, remove duplicates and convert it into a CSV file. ... C# - CSV Import Export Import a file - Outlook - Office.com - Microsoft Corporation ...Do not import duplicate items Existing data will be kept, and the duplicate ... In the File to import box, specify the path and file name of the .pst file you want ... Using the Import-Csv Cmdlet - Microsoft Corporation: Software ...Read in a Comma-Separated Values File. The Import-Csv cmdlet provides a way for you to read in data from a comma-separated values file (CSV) and then display that ... 7/23/2012 3:07:28 PM
|