PDA

View Full Version : Know how to do this?


nddwind
2004-08-30, 03:27 AM
I have a text file with 37,000 words within it (1 word per line) ranging from 1 character to 11 characters per word. I was wondering if anyone knew a way to remove all the words that are 3 characters and less from the list without going threw and searching forever.

`Insolence`
2004-08-30, 04:32 AM
LOL.

Password file?

Easily done in PHP/AutoIT.

Here, I'll even make the whole thing for you, I'm pretty bored:

rem 3 chars and under.au3


; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language: English
; Platform: Win9x / NT
; Author: Insolence <[email protected]>
; AIM: insolence9dotcom
;
; Script Function:
; Remove words from input file that contain less than 3 letters.
;
; ----------------------------------------------------------------------------

; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------

$input = FileOpen ( "passwords.txt", 0 )
$output = FileOpen ( "output.txt" , 2 )

; Check if file opened for reading OK
If $input = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

DIM $LineArray[99999]
$Line = 0

; Read in lines of text until the EOF is reached
While 1
$TempString = FileReadLine($input)
If @error = -1 Then ExitLoop

$strlen = StringLen ( $TempString )

If $strlen > 3 Then
$LineArray[$Line] = $TempString
$Line = $Line + 1
EndIf
Wend

$TempLine = 0

While $TempLine < $Line
FileWriteLine($Output, $LineArray[$TempLine])
$TempLine = $TempLine + 1
WEnd

FileClose($input)
FileClose($output)


Passwords.txt


1
22
333
4444
55555
666666
7777777
88888888
999999999


Creates:
output.txt


4444
55555
666666
7777777
88888888
999999999


PLEASE read the help file... the questions you ask are almost written write out for you... wait, they ACTUALLY are.

You could even modify that to put them in order.

Medieval Bob
2004-08-30, 09:53 AM
Man, don't put this shit in the D2 section...

SkyGoneBlue
2004-08-30, 10:23 AM
*confused as all hell*

Where do you guys learn this crap?

nddwind
2004-08-30, 10:25 AM
Muhahaha

thanks again bro

`Insolence`
2004-08-30, 11:16 AM
I taught myself... nddwind doesn't know what he's doing -.-

Vollstrecker
2004-08-30, 02:49 PM
Man, don't put this shit in the D2 section...

He posted the same thread in another forum, and Sovereign closed it.

Anyway, odds are that someone in D2 knew what he was doing and knew how to do what he wanted.