473,386 Members | 1,841 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.

Somthing I would find helpfull

Chrisjc
375 256MB
I only took a class on VB because I had to for school I don't recall all to much of it.. But I have a job now doing database administration. And I have to sort part numbers that are duplicated several times.. (I.E.)
========================================
49-10049
49-10049
49-10049
49-10049
49-10051
49-10051
49-10051
========================================

And this can be up to 200 lines... My question for anyone who could help me. I was thinking couldn’t I make a program in VB when I would load a TEXT full of these part numbers that are duplicated and then hit something like "SORT TO SINGLE" and it will take that list and make it into
========================================
49-10049
49-10051
========================================

This way I dont have to delete the part numbers out one by one like I have been doing.. This is a head ache... and would be grate if I can get a simple APPLICATION that can do this... Could any of you help me out please? Any or maybe code that for me?? WOULD BE A HUGE HELP!!! and save me a lot of time at work! Or maybe someone knows a program already like this????

So basic operation of the APPLICATION would be.

Open a text file in the APP that has duplicated part numbers in a format of
10-00000

Then take all duplicates out and only leave one of each part number....
So the out put would be the 2nd list of part numbers below. And the input would have been let’s say
10-00000
10-00000
10-00000 Program would take out those 2 and leave one. Is this possible?

10-00000
10-00001
10-00002

Does this make sense please let me know THANK YOU!! In advanced!


-Chris
May 7 '07 #1
5 1507
Tig201
103 100+
Couldn't you use a find duplicate query in in you databse manager and then use the results of that to populate the table in the database. I know this can be done in access but you didn't mention what your database software was.
May 7 '07 #2
SammyB
807 Expert 512MB
In case the DB solution cannot be done (isn't this just SELECT DISTINCT ...), you can easily remove duplicate data with Excel.

Just open your data file with Excel, insert a row at the top and put a label over the column ("Label" is fine, XL just wants something). Now, select the entire column (click on the "A"), and use the Data, Filter, Advanced Filter menu. In the dialog, tick Copy to another location, Copy to B1, place a checkmark in Unique records only, and press OK. Now, you can use the Edit, Delete menu item to delete the first column, select the header cell and delete it, and File, SaveAs to save your unique records.

Sam's First Rule of Programming: NEVER write a program that an Office App can already do. HTH --Sam
May 7 '07 #3
Chrisjc
375 256MB
In case the DB solution cannot be done (isn't this just SELECT DISTINCT ...), you can easily remove duplicate data with Excel.

Just open your data file with Excel, insert a row at the top and put a label over the column ("Label" is fine, XL just wants something). Now, select the entire column (click on the "A"), and use the Data, Filter, Advanced Filter menu. In the dialog, tick Copy to another location, Copy to B1, place a checkmark in Unique records only, and press OK. Now, you can use the Edit, Delete menu item to delete the first column, select the header cell and delete it, and File, SaveAs to save your unique records.

Sam's First Rule of Programming: NEVER write a program that an Office App can already do. HTH --Sam

That worked grate just what I needed thank you!

I am using EXCEL just to get all the data together.. Then convert it to CSV and upload to PHPMYADMIN. Thanks for the replies

PS I will admit newbi to XL hahaha
May 7 '07 #4
Killer42
8,435 Expert 8TB
That worked grate just what I needed thank you!

I am using EXCEL just to get all the data together.. Then convert it to CSV and upload to PHPMYADMIN. Thanks for the replies

PS I will admit newbi to XL hahaha
Ah, but I'll bet you're learning a lot about it now. :)

Are you going to be doing this on a regular basis? If so, it might still be a good idea to develop a program to do it. Or perhaps a better idea would be a macro in Excel, to automate things a little without taking it out of your hands. That will probably be much simpler than doing a VB application.

Excel can actually do most of the work of macro creation for you. Just tell it to "Record a new macro". Then do the operation yourself. Once you stop the recording, you'll have the VBA code there to do it again. Chances are good that you will need to play with the code a bit, unless the operation will be precisely the same each time. But at least the code is already there.
May 8 '07 #5
SammyB
807 Expert 512MB
That worked grate just what I needed thank you!

I am using EXCEL just to get all the data together.. Then convert it to CSV and upload to PHPMYADMIN. Thanks for the replies

PS I will admit newbi to XL hahaha
That's a little known but very useful XL feature. Glad it worked for you: now people will think that you are an XL wizard! Nobody knows how to use Advanced Filter!

But, can't you just use SELECT DISTINCT ... in the original query?
May 8 '07 #6

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

Similar topics

11
by: puzzlecracker | last post by:
Hi guys, These are some MS questions which i encountered in a recent interview. Hope it'll be helpfull to some of you. #1. Given an n X m grid of characters. You are supposed to search for a...
2
by: Ghost Dog | last post by:
After installing the .Net framework (v1.1) I lose the ability to find all DLL files on the C: drive. Show all files is checked, and hide extensions is unchecked in the folder option settings, and I...
0
by: badr | last post by:
i swear i try to test somthing in GOOOGLE groups you will see this againg
8
by: Victor Lamberty | last post by:
Greetings C coders I am new to the world of C and have been trying to compile this program. I got the result that I wanted but outputed it in a strange way it put it before the prompt is there a...
7
by: [Yosi] | last post by:
Hi, I create a thread which load DLL and have DLL function call,this Dll function takes a lot of time. My Question is , if I request Thread.Susspend(), and the thread is inside the Dll function...
15
by: Bjorn Jensen | last post by:
Hi! An beginner question: Pleas help me with this (-: Error (the arrow points on the s in sqrt) ===== tal.java:6: cannot find symbol symbol : method sqrt(int) location: class tal...
4
by: tathagata | last post by:
I want second highest value in a table without using subquery. please send this answer .It will be very helpfull.
5
by: Taftheman | last post by:
Hi, I am running a store procedure, which takes a long time so i need some way of telling the user somthing is happening. Any one have a sample code of how to do this?
15
by: Kurda Yon | last post by:
Hi, I try to "build" and "install" pysqlite? After I type "python setup.py build" I get a lot of error messages? The first error is "src/ connection.h:33:21: error: sqlite3.h: No such file or...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.