Script to count duplicate lines in a text file

We have a requirement to count the number of duplicate entries in a text file 
and then list the line and the number of duplicates.  For example, we have a 
file call test.txt that has the following entries:
A1
A1
B1
B2
B2
B2
B2
This would return the following:
A1,2
B1,1
B2,4

Any assistance would be greatly appreciated
0
Utf
9/30/2010 6:07:03 AM
scripting.vbscript 564 articles. 0 followers. Follow

19 Replies
3829 Views

Similar Articles

[PageSpeed] 53

Gadgetman schrieb:
> We have a requirement to count the number of duplicate entries in a text file
> and then list the line and the number of duplicates.  For example, we have a
> file call test.txt that has the following entries:
> A1
> A1
> B1
> B2
> B2
> B2
> B2
> This would return the following:
> A1,2
> B1,1
> B2,4
>
> Any assistance would be greatly appreciated

Create a Dictionary to hold the lines (key) und their frequencies (values)
Open the file ForReading and loop until AtEndOfStream
put each line into the Dictionary
    dicLines( sLine ) = dicLines( sLine ) + 1
Display the Dictionary
    For Each sLine In dicLines.Keys
        WScript.Echo sLine, dicLines( sKey )
0
ekkehard
9/30/2010 10:51:36 AM
The scripting help files are here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9

FileSystemObject deals with file I/O. Textstream is
the object for reading/writing files.

  Lots of people are happy to help but it sounds like
you're asking for someone to write your script. People
don't just hang around here waiting for a chance to do
other peoples' work for free. If you come up wit a script
then you can ask here for help.

| We have a requirement to count the number of duplicate entries in a text 
file
| and then list the line and the number of duplicates.  For example, we have 
a
| file call test.txt that has the following entries:
| A1
| A1
| B1
| B2
| B2
| B2
| B2
| This would return the following:
| A1,2
| B1,1
| B2,4
|
| Any assistance would be greatly appreciated 


0
Mayayana
10/1/2010 1:57:36 AM
On 1 Oct, 02:57, "Mayayana" <mayay...@invalid.nospam> wrote:

> People don't just hang around here waiting for a chance to do
> other peoples' work for free.

Ignore the top posting unhelpful troll. I had 20 minutes to spare so I
knocked out this little example

'*****Script start*****
'Create a Dictionary to hold the lines (key) und their frequencies
(values)
Set diclines = CreateObject("Scripting.Dictionary")

'Invoke the File System Object
Set FSO = CreateObject("Scripting.FileSystemObject")

'Filename passed as argument
Strfilename = wscript.arguments(0)

'Show Filename
wscript.echo Strfilename

'Open the file for reading
Const ForReading = 1
Set objFile = FSO.OpenTextFile(strFileName, ForReading)

'Loop until end of stream
Do Until objFile.AtEndOfStream
    'Read each line
    Fline = objFile.ReadLine
    'If line is not already in dictionary, add Item
    'and set key value to 1
    'If line is already in dictionary, increment key value
    If Not diclines.Exists(Fline) Then
        diclines.Add Fline , 1
    Else
        dicLines( FLine ) = dicLines( FLine ) + 1
    End If
Loop
objFile.Close

'Show keys and items
For Each element In diclines
    wscript.echo element & "," & diclines(element)
Next
'*****Script end*****

*****test.txt*****
Beijing
Beijing
Beijing
Beijing
Beijing
Beijing
Beijing
Beijing
Beijing
Beijing
Berlin
London
London
London
London
London
London
London
London
London
London
London
London
London
London
New York
New York
New York
New York
New York
New York
Tokyo
Tokyo
Tokyo
Tokyo
Tokyo
Tokyo

****Output
test.txt
Beijing,10
Berlin,1
London,14
New York,6
Tokyo,6





0
contrex
10/3/2010 8:35:25 AM
"contrex" <mike.j.harvey@gmail.com> wrote in message 
news:de11c212-caa7-4432-b43c-339a06814264@l20g2000yqm.googlegroups.com...
> On 1 Oct, 02:57, "Mayayana" <mayay...@invalid.nospam> wrote:
>
>> People don't just hang around here waiting for a chance to do
>> other peoples' work for free.
>
> Ignore the top posting unhelpful troll. I had 20 minutes to spare so I
> knocked out this little example

  I guessed you missed the part of the OP saying "We have a requirement" 
which implies something beyond an individual needing assistance and more 
likely the company or orgainzation the OP is a part.  That the OP asked for 
assistance is inaccurate, lacking the foundation the OP had already made an 
unsuccessful attempt on his own, you (and the rest of the planet) could 
conclude the OP wanted someone to do the work for him ( or the organization 
that employs him, how is that helpful?).

  So Mayayana's response was maybe curt, but exactly right and your comments 
to the contrary would be dismissed out of hand by most vampire 
hunters/haters.

http://slash7.com/2006/12/22/vampires/


> '*****Script start*****
> 'Create a Dictionary to hold the lines (key) und their frequencies
> (values)
> Set diclines = CreateObject("Scripting.Dictionary")
>
> 'Invoke the File System Object
> Set FSO = CreateObject("Scripting.FileSystemObject")
>
> 'Filename passed as argument
> Strfilename = wscript.arguments(0)
>
> 'Show Filename
> wscript.echo Strfilename
>
> 'Open the file for reading
> Const ForReading = 1
> Set objFile = FSO.OpenTextFile(strFileName, ForReading)
>
> 'Loop until end of stream
> Do Until objFile.AtEndOfStream
>    'Read each line
>    Fline = objFile.ReadLine
>    'If line is not already in dictionary, add Item
>    'and set key value to 1
>    'If line is already in dictionary, increment key value
>    If Not diclines.Exists(Fline) Then
>        diclines.Add Fline , 1
>    Else
>        dicLines( FLine ) = dicLines( FLine ) + 1
>    End If
> Loop
> objFile.Close
>
> 'Show keys and items
> For Each element In diclines
>    wscript.echo element & "," & diclines(element)
> Next
> '*****Script end*****
>
> *****test.txt*****
> Beijing
> Beijing
> Beijing
> Beijing
> Beijing
> Beijing
> Beijing
> Beijing
> Beijing
> Beijing
> Berlin
> London
> London
> London
> London
> London
> London
> London
> London
> London
> London
> London
> London
> London
> London
> New York
> New York
> New York
> New York
> New York
> New York
> Tokyo
> Tokyo
> Tokyo
> Tokyo
> Tokyo
> Tokyo
>
> ****Output
> test.txt
> Beijing,10
> Berlin,1
> London,14
> New York,6
> Tokyo,6
>
>
>
>
> 


0
mbyerley
10/3/2010 2:11:33 PM
On 3 Oct, 15:11, "mbyerley" <mDotByerley@VerizonDottieNettie> wrote:

> =A0 So Mayayana's response was maybe curt, but exactly right and your com=
ments
> to the contrary would be dismissed out of hand by most vampire
> hunters/haters.
>

I am guessing by the nature of your post that you are aged about 12 or
13. Please keep quiet until you learn some wisdom, if that ever
happens.


0
contrex
10/3/2010 3:30:11 PM
"contrex" <mike.j.harvey@gmail.com> wrote in message 
news:285d5e4f-9587-4a13-afb1-4347bdf247f6@x42g2000yqx.googlegroups.com...
On 3 Oct, 15:11, "mbyerley" <mDotByerley@VerizonDottieNettie> wrote:

> So Mayayana's response was maybe curt, but exactly right and your comments
> to the contrary would be dismissed out of hand by most vampire
> hunters/haters.
>

>I am guessing by the nature of your post that you are aged about 12 or
>13. Please keep quiet until you learn some wisdom, if that ever
>happens.

Yeah close.  My youngest grandchild is about that age.





0
mbyerley
10/3/2010 5:10:13 PM
On 3 Oct, 18:10, "mbyerley" <mDotByerley@VerizonDottieNettie> wrote:

> Yeah close. =A0My youngest grandchild is about that age.

When he or she asks for a story at bedtime, do you charge him or her
for the work?
0
contrex
10/3/2010 6:30:33 PM
"contrex" <mike.j.harvey@gmail.com> wrote in message 
news:a4f59189-3381-4122-b153-2637b6b71485@e14g2000yqe.googlegroups.com...
On 3 Oct, 18:10, "mbyerley" <mDotByerley@VerizonDottieNettie> wrote:

> Yeah close. My youngest grandchild is about that age.

>When he or she asks for a story at bedtime, do you charge him or her
>for the work?

No.

I am the oldest of eight siblings, born during the second world war in 
relatively poor beginnings.
I have worked at tasks you couldn't imagine to be where I am today without 
lying, cheating, stealing or being dishonest in any way.  I did my best to 
impart to their moms and dads the synopsis of the many endeavors that I 
embarked upon  and that is "nothing of value in life is free.  Everything 
has a price. The price for failure is higher, but the coin for it's purchase 
is more common." (unk source anymore)

My children, without a divorce amonst any of them,  are Electronic Engineer, 
Prosecuting Attorney, and a Paralegal respectively, with their oldest 
children in their early 20's  I make no apologies for my thought processes 
(or teachings) to anyone.

There are no lazy-ass slackers in our family and to be certain, none that 
would waste their time engaging in a meaningless pissing contest where the 
outcome is both people ending up with wet shoes.



0
mbyerley
10/3/2010 7:35:44 PM
| >I am guessing by the nature of your post that you are aged about 12 or
| >13. Please keep quiet until you learn some wisdom, if that ever
| >happens.
|
| Yeah close.  My youngest grandchild is about that age.
|

  Well, on the bright side, at least contrex can't
accuse you of having a grandmother who wears
army boots. :) 


0
Mayayana
10/3/2010 7:41:04 PM
On 3 Oct, 20:35, "mbyerley" <mDotByerley@VerizonDottieNettie> wrote:

> There are no lazy-ass slackers in our family and to be certain, none that
> would waste their time engaging in a meaningless pissing contest

Like the one that you have now posted in three times?








0
contrex
10/3/2010 9:24:47 PM
"Mayayana" <mayayana@invalid.nospam> wrote in message 
news:i8am53$6jb$1@news.eternal-september.org...
>| >I am guessing by the nature of your post that you are aged about 12 or
> | >13. Please keep quiet until you learn some wisdom, if that ever
> | >happens.
> |
> | Yeah close.  My youngest grandchild is about that age.
> |
>
>  Well, on the bright side, at least contrex can't
> accuse you of having a grandmother who wears
> army boots. :)

  Well, probably boots of some kind.  Farmers you know.

> 


0
mbyerley
10/3/2010 11:45:35 PM
| >  Well, on the bright side, at least contrex can't
| > accuse you of having a grandmother who wears
| > army boots. :)
|
|  Well, probably boots of some kind.  Farmers you know.
|

   That may be a somewhat local reference
that I shouldn't expect others to get. The
expression represents an absurd level of
namecalling on the part of simpletons:
"Oh yeah, well your grandmother wears army
boots." I don't know where it comes from.
Probably something like Rowan and Martin's
Laugh-In. 


0
Mayayana
10/4/2010 2:59:01 AM
"Mayayana" <mayayana@invalid.nospam> wrote in message 
news:i8bfq9$u1h$1@news.eternal-september.org...
>
> | >  Well, on the bright side, at least contrex can't
> | > accuse you of having a grandmother who wears
> | > army boots. :)
> |
> |  Well, probably boots of some kind.  Farmers you know.
> |
>
>   That may be a somewhat local reference
> that I shouldn't expect others to get. The
> expression represents an absurd level of
> namecalling on the part of simpletons:
> "Oh yeah, well your grandmother wears army
> boots." I don't know where it comes from.
> Probably something like Rowan and Martin's
> Laugh-In.

I don't know about R & M being the origin as I'm pretty sure it predates 
them.
It is a saying from my childhood, which you could deduce easy enough, was a 
while back. :)

But my recollection was "Your Mother wears combat boots".

> 


0
mbyerley
10/4/2010 11:47:07 AM
| I don't know about R & M being the origin as I'm pretty sure it predates
| them.
| It is a saying from my childhood, which you could deduce easy enough, was 
a
| while back. :)
|
| But my recollection was "Your Mother wears combat boots".
|

  That makes sense. If you're *that* old then it was
probably your mother but my grandmother. :)

  That's an interesting example of how a thing can keep
coming back in cycles, with each generation assuming
it originated with them. Like so:

http://en.wikipedia.org/wiki/Boogie_Woogie_Bugle_Boy#Later_versions_of_the_song




0
Mayayana
10/4/2010 2:28:59 PM
On 4 Oct, 15:28, "Mayayana" <mayay...@invalid.nospam> wrote:

[snipped]

What a bunch of offtopic trash. You dweebs. I have sent my script
direct to Gadgetman and killfiled you two idiot trolls.
0
contrex
10/4/2010 5:13:46 PM
mbyerley wrote:
> "contrex" <mike.j.harvey@gmail.com> wrote in message 
> news:de11c212-caa7-4432-b43c-339a06814264@l20g2000yqm.googlegroups.com...
>> On 1 Oct, 02:57, "Mayayana" <mayay...@invalid.nospam> wrote:
>>
>>> People don't just hang around here waiting for a chance to do
>>> other peoples' work for free.
>>
>> Ignore the top posting unhelpful troll. I had 20 minutes to spare so I
>> knocked out this little example
>
>  I guessed you missed the part of the OP saying "We have a requirement" 
> which implies something beyond an individual needing assistance and more 
> likely the company or orgainzation the OP is a part.  That the OP asked 
> for assistance is inaccurate, lacking the foundation the OP had already 
> made an unsuccessful attempt on his own, you (and the rest of the planet) 
> could conclude the OP wanted someone to do the work for him ( or the 
> organization that employs him, how is that helpful?).
>
>  So Mayayana's response was maybe curt, but exactly right and your 
> comments to the contrary would be dismissed out of hand by most vampire 
> hunters/haters.
>
> http://slash7.com/2006/12/22/vampires/

This site exactly pin points a number of the requesters. URl squirreled away 
for future use.

Very good response. The question sounded like elementary homework which 
several of us have seen many times over.

-- 
Todd Vargo

(Post questions to group only. Remove "z" to email personal messages) 

0
Todd
10/4/2010 9:48:29 PM
"Todd Vargo" <tlvargo@sbcglobal.netz> wrote in message 
news:i8di4q$o7s$1@news.eternal-september.org...
> mbyerley wrote:
>> "contrex" <mike.j.harvey@gmail.com> wrote in message 
>> news:de11c212-caa7-4432-b43c-339a06814264@l20g2000yqm.googlegroups.com...
>>> On 1 Oct, 02:57, "Mayayana" <mayay...@invalid.nospam> wrote:
>>>
>>>> People don't just hang around here waiting for a chance to do
>>>> other peoples' work for free.
>>>
>>> Ignore the top posting unhelpful troll. I had 20 minutes to spare so I
>>> knocked out this little example
>>
>>  I guessed you missed the part of the OP saying "We have a requirement" 
>> which implies something beyond an individual needing assistance and more 
>> likely the company or orgainzation the OP is a part.  That the OP asked 
>> for assistance is inaccurate, lacking the foundation the OP had already 
>> made an unsuccessful attempt on his own, you (and the rest of the planet) 
>> could conclude the OP wanted someone to do the work for him ( or the 
>> organization that employs him, how is that helpful?).
>>
>>  So Mayayana's response was maybe curt, but exactly right and your 
>> comments to the contrary would be dismissed out of hand by most vampire 
>> hunters/haters.
>>
>> http://slash7.com/2006/12/22/vampires/
>
> This site exactly pin points a number of the requesters. URl squirreled 
> away for future use.
>
> Very good response. The question sounded like elementary homework which 
> several of us have seen many times over.

In the couple Delphi groups I lurk there is superb help when needed, but if 
you tendered a post like the OP, you would be shown the door.

Most of these groups have talented and helpful people that are willing to 
put a shoulder to it when it appears the other guy is bearing some of the 
load too.

It's really hard to come up against something you just can't find anything 
about out in the wild.

> -- 
> Todd Vargo
>
> (Post questions to group only. Remove "z" to email personal messages) 


0
mbyerley
10/5/2010 2:37:09 AM
Il giorno Sun, 3 Oct 2010 01:35:25 -0700 (PDT), contrex <mike.j.harvey@gmail.com> ha
scritto:
>On 1 Oct, 02:57, "Mayayana" <mayay...@invalid.nospam> wrote:
>
>> People don't just hang around here waiting for a chance to do
>> other peoples' work for free.
>
>Ignore the top posting unhelpful troll. I had 20 minutes to spare so I
>knocked out this little example

I agree with Mayayana (who is absolutely not a troll) and mbyerley.
It's a good thing that you have the spare time to write the scripts for those who ask for
that.
Soon you will realize that in this ng many people just want someone else to solve their
problems, do not have any idea of vbscript and do not want to learn it. When you will run
out of time you will answer like Mayayana often does: "let's see what you have done so far
and where you are stuck".
Your script is very interesting. I don'know much about the dictionary object. I would have
done it with an array in a more complex manner, reinventing the wheel.
G.



-- 
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
-- 
0
noone
10/6/2010 9:01:25 PM
I was actually just looking for a starting point - as to the best possible 
way to perform the task required.  Thanks to all who put me on the right 
path, which I had started down with the post from here 
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.scripting.vbscript&tid=6bcfe32c-434a-4aaf-b1d9-2997e64a5ed5&cat=en_US_8e0bf598-2567-4b0b-8241-d4942bda87dc&lang=en&cr=US&sloc=en-us&m=1&p=1 
which I found over the weekend after I had posted.
It was not my intention to have someone write the script for me, but thanks 
to those who have provided this as well.


0
Utf
10/6/2010 9:52:04 PM
Reply:

Similar Artilces:

Formatting Text in a Forwarded Email Message
Odd problem in Outlook on one of our pc's. We are using Outlook 2002 SP3. When attempting to forward a message, I sometimes change a few of the words in the body of the message. I place the cursor within the word I wish to change. As soon as I type one letter, any letter, the letter shows up two font sizes bigger (from 12 to 14), and with a space on each side of the inserted letter. What seems to make this more puzzling is that when I attempt the same task on our other pc, everything functions as it should; no change in font size and no extra spaces. Any help in eli...

How do I expand the amount of text I can put in a cell?
I am entering text into a cell & can see it in the formula bar up top, but it's giving me the #### in the cell that states it's too big. How can I get it to show my text? Sarah - Put your cursor between the column you want to expand, and the column to the right. When you see a four sided arrow, click and drag it to the right. You may need to also Format, Cell, Alignment and click on Wrap Text. Hope this helps, Carole O "Sarah" wrote: > I am entering text into a cell & can see it in the formula bar up top, but > it's giving me the #### in the cell...

Legend Line Spacing
Is there a way in VB to force a legend to display in single line spacing rather than what appears to be double line spacing? I am using the following code to control the display of the legend. Is there a property I can add that will control the line spacing? ActiveChart.Legend.Select Selection.AutoScaleFont = False With Selection.Font .Name = "Arial" .FontStyle = "normal" .Size = 9 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Under...

.qfx file in excel
my bank for some reason will only allow me to download my statement in a qfx file (quicken) but i dont have any quicken programs i use excel to manage my finances how can i open this file up??? If the bank does not have .text (.txt) or comma separated variables (.csv), which would probably be listed as spreadsheet format, then I would complain to the bank. Meanwhile you could copy and paste from your checking activity HTML pages. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: ...

.mdi Files
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have some .mdi files (generated at work with some lab software). They seem to open okay on my work PC. Is there any way that I can get Office 2008 and a MAC to recognize / open these? No, .mdi is a Windows-only format exclusive to the Microsoft Document Imaging program... Even other Windows apps can't read or create them. If you can get them into a Windows box open them in MDI & then Save As TIFF to get a format that can be opened by graphics apps or inserted into other documents as a picture. TIFF files are ...

Comparing text strings
I have two columns populated with names and I need to compare them for duplicates. Some duplicate names may contain middle initial or middle names and some don't. So they may not be EXACT. Please give me suggestions on formulas or funcions that would help me accomplish this task. Thanks. On Fri, 27 Nov 2009 11:12:01 -0800, Comparing columns with text <Comparing columns with text@discussions.microsoft.com> wrote: >I have two columns populated with names and I need to compare them for >duplicates. Some duplicate names may contain middle initial or middle names ...

Unable to start up my Excel files
One of my users have this odd issue with his Excel 2003. He's unable to start the files directly but instead he must start a blank excel sheet then open his files from there. Is there a solution to this issue? Please advise. Thanks! Dell 170L P4 800mghz 1gbram Windows XP Pro SP2 Office 2003 SP2 Could the problem be that he cannot open files by double-clicking on them from Windows Explorer, but must open Excel (which will launch a blank sheet) and then open them directly from there using File / Open... If so then tell him to try Tools / Options / General / untick 'Ignore Othe...

File password override
I'm trying to restore a backup file. Money is asking for a file password. I enter the password that is appropriate for the Passport account used to lock the file, but Money will not accept that. I wonder if this file has a seperate file password and if so, I have no memory of what it may have been. Is there some way to reset it? Is there some other way in to this file? Thanks Though I sympathize with your problem, I certainly hope there's no back door. If there is, I'm going back to paper records. I shudder to think that a hacker could conceivably get an older backup file an...

How to use the countif() function to count items in a table
I have a table contains multple columns of info as shown in the below AcctID ProjectName PMName Phase Status EIG Project 1 Wellie Initiation New MLI Project 2 John Develop Active EIG Project 11 Wellie Qualify Active EIG Project UUU John Design InActive MLI Project XX Carol Deployment Completed MLI Project YYY Carol Design Active I'd like to use the countif() function to complete the following metric such that I know how many projects for each status for each AcctID. EIG ...

Change a text box to a combo box
Hi there I have created several forms in my database. I realized that I should have made them combo boxes instead of text boxes. Is there any easy way for me to change them into the format I need? Thank you in advance for your help. Right-click on the text box and select changeTo from the menu. -- Reggie "forest8" <forest8@discussions.microsoft.com> wrote in message news:FD867B89-38CC-4F20-A9AE-C177444DA9DA@microsoft.com...the > Hi there > > I have created several forms in my database. > > I realized that I should have made them combo ...

opening .dat Accounts Receivable file in Great Plains for DOS
Hi There: We are trying to retrieve some information from a posted accounts receivable report... We think its in a .dat file but have no way of opening... This anyone know if this is possible... Any help or suggestions would be greatly appreciated! Sincerely, Carmine Carmine, Can you be a little more specific? What version of GP, what report, what information? Victoria "Carmine" <Carmine@discussions.microsoft.com> wrote in message news:839CC67C-A4C7-4584-8119-C40F74960573@microsoft.com... Hi There: We are trying to retrieve some information from a posted accounts ...

Pivot Table Text Only, No calculations
:confused: I have a spreadsheet of data, text only. An address list. want to look at the table by city. Is there a way to do this withou calculation? For example, I want to have a city has the page field an look at all the addresses, including columns, within that city. Thanks -- rmm3 ----------------------------------------------------------------------- rmm30's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=835 View this thread: http://www.excelforum.com/showthread.php?threadid=26902 A pivot table is a good tool for summarizing data, but won't help...

Creating a duplicate lead
Am I right in assuming there is no way to create a duplicate lead from an existing one? I'm asking because I have multiple people within the same company - would like to add a second lead without retyping all the address info, etc., that would be exactly the same. check out the free c360 Clone utility: http://www.c360.com/Clone.aspx It'll do what you need. -Sarah B. "jjohnson" wrote: > Am I right in assuming there is no way to create a duplicate lead from an > existing one? I'm asking because I have multiple people within the same > company - would ...

csv-file problems with different regions
I have imported an American csv-file into a German Excel XP. The American $-values are separated by a "." while the German currency values are separated by a ",". So now my spreadsheet reads a value of $ 18.01 as 18. January. All values above 18.12 are ok. How can I avoid this problem? Or, can I change the values tediously one cell after the other? I have not found a way yet as even when I try to format a cell user defined it automatically changes to the format used in the German region. Thanks. Hans Temporarily change the regional settings on your computer to the same f...

File set up query.
Can i set up an excel file to open automatically on pc start up? The easiest is to use the Startup folder available in the Start Menu. To access it go to Start - Programs - Startup. You can delete or add tasks here according to your needs. They will start after Windows logon. When you start Excel, all the files that are located in the XLStart folder are automatically opened. Additionally, if you specified an alternative startup folder for Excel, every file in that folder is also automatically opened. To specify an alternative startup folder, in Microsoft Excel 2002 or Microsof...

Sorting file list by date/time...
Hello, does anybody have an idea how to program a sorting function given a directory with files, which should red to an array which is sorted by date and time, but contains only the filenames. Is there a MFC function or a shell function of the OS which could ease the job instead of doing it manually? Regards, Diana On Mon, 16 Apr 2007 16:39:50 +0200, "Diana Bulthaupt" <Diana.Bulthaupt(at)web.de> wrote: >does anybody have an idea how to program a sorting function given a >directory with files, which should red to an array which is sorted by date >an...

97: How can I find duplicate entries in a column?
Hello and thanks in advance for any help. This is a very basic question from an even more basic user. I have a spread sheet with a long list of ID numbers for skips. Sometimes duplicate numbers arise from paper work from elsewhere and I get a false total of skips in hand. How can I organise that column to highlight a duplicate entry please? Shen --- Message posted from http://www.ExcelForum.com/ Insert a helper column: =COUNTIF(A1:A9999,A1) (adjust the range to suit.) then the formulas that evaluate to more than 1 will be duplicated. Chip Pearson has some other techniques at: http://ww...

Displaying Text
Hello, I have an MFC application, where I'm interested in displaying some text for the user in the client area. To do this, I create a device context, and use the .TextOut method to display CStrings. The problem begins when the window is resized, or when a menu that hides the text pops - once the menu is closed, or after the window has been resized, the text (or parts of it) are being erased. How can this be solved? I read that when the window is resized, OnPaint is called, and thus I tried displaying the text from there - hoping to re-display it "after" it has been erased. The...

Linking text to style for auto update
I want to auto update figure/table number in text to that in Figure/Table style numbers Use Insert > Cross Reference to put the numbers into the text; they don't update every time the numbering changes, but only when you tell them to (Ctrl-A, F9) or when you print or switch to Print Preview. On Dec 18, 4:05=A0pm, Taurus <Tau...@discussions.microsoft.com> wrote: > I want to auto update figure/table number in text to that in Figure/Table > style numbers ...

Can I access the previous version of a saved file?
I overwrote an excel file by mistake, using the save as command to an incorrect file. Is there any way to recover the previous file before I "saved as" over it? Hi! I'm using Excel 10 (XP)......WinXP....... If I have an existing file and open it, make some changes, then do a SAVE AS and give it a different name, the newly "saved as" file is a completely *NEW* file and the original is still in tact with the previous file name. Try looking for the previous file name. Biff "JCC" <JCC@discussions.microsoft.com> wrote in message news:9CAD1748-1D5C...

How to 1. Jump to a specific page (in a massive document) based on a search then 2. Copy and paste an string of characters a few lines above it.
BACKGROUND/CONTEXT I am working from a very large word document, approximately 1000 pages long. Each page has one 'article' on it. I am currently doing something manually, which I would love to do using a macro. I am populating a table (which happens to be in an Excel spreadsheet) One column is the Article number 'xxxxx'. One of the other columns is a 'Topic' which is typically three alphanumeric characters (like AA1, AD4, BB4 DO6 etc.) PROBLEM/TASK This is what i have to do Step 1 - Jump to the page with the article number. Achieved by p...

how to edit Adobe file
how to edit Adobe file Most certainly not in Word. pdf files, I'm assuming that is what you mean by 'Adobe files', are 'fixed' files. Their layout is frozen so they look the same on any machine and can not be edited. If you still want to edit such a pdf file, you will have to convert the file to something else, edit it, and then save the result back as a pdf. The best tool to do the conversion of pdf files to Word documents is probably Acrobat Professional. Unfortunately, that is a rather expensive product to use for a few simple conversions. There are ...

Advanced Filtering
Hello, I've got a worksheet with four columns, one of which is a user name. I would like to take all the user names that contain numbers (and their respective data) and put it into a separate worksheet. So far, I haven't had any luck doing this with any combination of wildcard operators. The format of the user names are two or three letters and then 4 numbers, or they are entirely text. So the list has data like abc1234, ab1234 and abcdef. I want all the abc1234 and ab1234 entries in a separate list. Any suggestions? Thanks in advance. Maybe you could use a helper column and filt...

URGENT: Exporting table to an SQL script
Hi guys I have a database in Access 2007 which I'm currently trying to rebuild in SQL Server Express in Visual Studio. Problem is, I can't seem to find an easy way of exporting tables. I've been using copy/paste on the data, but that only works with simple tables where I can build the table in SQLEx first. Is there a way in Access 2007 (or an Add-in I can download) to export a table as a list of SQL commands? Yknow.. CREATE TABLE, INSERT, etc!? Thanks, Dan Hi, you can use upsizing wizard to export whole database, or Export tables to ODBC connection to your sql server...

Count invalid data entries
I am using the following macro to identify invalid data entries in cells with data validation applied. Sub CheckOrder() ' Application.CommandBars("Formula Auditing").Visible = True ActiveSheet.CircleInvalid Sheets("Configuration").CircleInvalid Sheets("Parts_TakeOff").CircleInvalid MsgBox ("Check for Red Circled Invalid Data Entries on" & Chr(10) & " Configuration and Parts_TakeOff Sheets") End Sub Is there a way to count the number of invalid data entries (red circles) and write the number to a particular ce...