Creating A unique List In TextPad??

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
theghost
Posts: 6
Joined: Sun Dec 24, 2006 7:46 am

Creating A unique List In TextPad??

Post by theghost »

Dear Forum members,

Can anyone help me?
What I'm trying to achieve is the following;
I have a big keyword list saved in TextPad.
Something like the following,

car rent
car hire
cars for rent uk
etc etc etc

All on seperate lines, about 2000 lines in total.
What I want to know is there any way of selecting the whole list and exporting it (To save it as another list. A list of just unique keywords??

So, It would create a list like;
car
rent
uk
hire
for
etc etc etc.

This is so I can see from a huge list what all the unique keywords are.
Is there a way of doing this now within TaxPad Now?? or has someone made a plug in that can achieve this??
I've looked at the sort tab, but it doen't appear to have this fuction?

Any thoughts on this would be great.
Many Thanks
John
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

replace all non-word-characters (e.g space, full stop, question mark, \t for a tab character ...) by line-breaks (you need to do a Regular Expression replace, put all the characters you want/need to replace in the "Find" box in []. Put \n in the replace box. Do a replace all.
Now you should have loads of lines, each having one word in it - but there might still be duplicates. To eliminate these, do a Tools - Sort and make sure to have "Delete duplicate lines" checked. There might be one empty line which you have to remove manually.
theghost
Posts: 6
Joined: Sun Dec 24, 2006 7:46 am

Mudguard

Post by theghost »

Cheers.
You don't know how much I needed to do this!
Really, thanks a lot.

I even put a post on Mr. Excel. I'm a real beginner in excel (Can just about sort columns etc)
They've come back with some wierd formulas like this;
Sub key()
Dim wb As Workbook
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Set wb = ThisWorkbook
Set ws1 = wb.Worksheets("Sheet1")
Set ws2 = wb.Worksheets("Sheet2")


lr = ws1.Cells(65536, 1).End(xlUp).Row

For i = 1 To lr

With ws1
.Cells(i, 1).TextToColumns Destination:=.Cells(i, 1), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
lc = .Cells(i, 256).End(xlToLeft).Column
.Cells(i, 1).Resize(, lc).Copy Range("d1")
.Range("d1").CurrentRegion.Copy

.Range("k1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True

.Range("k1").CurrentRegion.Copy
fr = .Cells(65536, 15).End(xlUp).Row
.Cells(fr, 15).PasteSpecial (xlValues)
.Range("d1").CurrentRegion.Clear
.Range("k1").CurrentRegion.Clear
lr2 = ws2.Cells(65536, 1).End(xlUp).Row + 1
.Range("o1").CurrentRegion.Copy ws2.Cells(lr2, 1)
.Range("o1").CurrentRegion.Clear
End With
Next i
With ws2
.Range("a1").Value = "Key"
.Range("A1:A9").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("D1" _
), Unique:=True
.Range("a1").CurrentRegion.Clear
.Range("d1").CurrentRegion.Copy .Range("a1")
.Range("d1").CurrentRegion.Clear
End With
End Sub
-------------------------------------------------------------------------------

and this one;
Sub test()
Application.DisplayAlerts = False
Columns(1).Replace What:=" ", Replacement:=Chr$(10), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns(1).Copy
Workbooks.Add
Range("A1").PasteSpecial
With ActiveWorkbook
.SaveAs "C:\test.prn", FileFormat:=xlTextPrinter
.Close
End With
Workbooks.OpenText "C:\test.prn"
End Sub
--------------------------------------------------
I have to email them as I tried both, and niether worked. Not their fault. I'm very gratefull they contacted me asap like yourself.
I've probably done it wrong :-)

But I've just tried yours and Hay! Worked first time!:-)

Many thanks
Merry Christmas to you all

The Ghost
Post Reply