Jump to content

Recommended Posts

Posted (edited)

Hmm, is there a way we could remove the dupes if the lines were not adjacent using the RegExpReplace?

I'm not 100% postive they will never come in the form:

<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>
<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>
<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>
<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>

as well as adjacent to eachother (and there can be varying amounts from 1-10ish..)

Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Posted

Hmm, is there a way we could remove the dupes if the lines were not adjacent using the RegExpReplace?

I'm not 100% postive they will never come in the form:

<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>
<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>
<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>
<SourceFile>TreeLock 1.24.cs</SourceFile>
<SourceFile>Pogue 2.33.cs</SourceFile>

as well as adjacent to eachother (and there can be varying amounts from 1-10ish..)

I don't know about getting the whole file in one shot, but in your original example they were grouped between <LoadClasses> and </LoadClasses> tags. Is that consistent throughout the file? Does the same .cs file name ever show up in more than one <LoadClasses> grouping? Details like that will determine how hard it is, I would think.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted (edited)

Hmm, is there a way we could remove the dupes if the lines were not adjacent using the RegExpReplace?

as well as adjacent to eachother (and there can be varying amounts from 1-10ish..)

Hi,

1-10 different files? (or 1-10 duplications of 2 files?)

Maybe you need to post a segment of your files with all possible permutations?

Best, Randall

[should be easy if there's only 1-10 pairs, but only 2 files each time!] -

(?m)^(.*\r\n.*\r\n)\1+
Edited by randallc
Posted (edited)

Lets just say that all <SourceFiles> can be duplicated any number of times in any order.. wether that be in a pattern, adjacent, or not. There could possibly be up to 10 different <SourceFiles> such as "TreeLock.cs" or "Pogue.cs" or "Warrior.cs". I need the clear the dupes of them as quickly as possibly because these files could be filled to the brim with dupes.

The RegExpReplace seems like it is by far the fastest method but I dont know if a pattern exists that will allow for this kind of removal.

<?xml version="1.0"?>
<GliderConfig>
  <WaypointCloseness>5.0</WaypointCloseness>
  <WebNotifyCredentials>
  </WebNotifyCredentials>
  <WebNotifyEnabled>False</WebNotifyEnabled>
  <WebNotifyURL>
  </WebNotifyURL>
  <WindowPos>-1244,346</WindowPos>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Warrior.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Warrior.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Pogue 2.33.cs</SourceFile>
    <SourceFile>Warrior.cs</SourceFile>
    <SourceFile>Warrior.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
    <SourceFile>TreeLock 1.24.cs</SourceFile>
  </LoadClasses>
</GliderConfig>
Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Posted

Hi,

Looks like it is possible after all.

I posted a query at a Regexp forum, and there are some answers;

Regexp Remove duplicate lines

Along the lines of "(?m)^(.*+)$(?=(?:\r?\n.*+)*?\r?\n\1$)" and "^(.*+)\r?\n(?=(?:.*+\r?\n)*?\1$)"

I haven't got them working in AutoIt yet; maybe psaltyDS has time to get it going?

I will have time later..

Best, randall

Posted

Great find randallc! I just read that regexp forum thread you posted. I've attempted to convert "(?m)^(.*+)$(?=(?:\r?\n.*+)*?\r?\n\1$)" and "^(.*+)\r?\n(?=(?:.*+\r?\n)*?\1$)" to work with autoit's regular expression as well but have had little success. I'll keep tinkering with it.

PsaltyDS, maybe if you get a chance take a look at that pattern.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Posted

Hi,

I do have it wrking, but depends on the original fi;le i make!

'I need a more "real" file to test, I think;

But it returns only one set of everything, but no "Sourcefile" is missing; depends what you want

StringRegExpReplace($sFileData, "(?m)^(.*+)\r?\n(?=(?:.*+\r?\n)*?\1$)", ""); ; errors out if multipke "1st line XML version in file;oรรท ร™ยซยญยข+ร˜รฌIยตร•รรIรกร€รŒยนร”รŒ(รญรธร•ร‘ยฝ%รร]ร‰รรร‰}Uรยนรยครตรครฌยกร‘ร‘ร€รจยผยฝร‰รกร™ยฅยนยฝยดยฝยฝร‰ร•ยตรŒยผร„ยผรŒรœร รครœยฝMยกยฝรQยกร‰ยนรรร (รญรธยฅยนยฑร•ยฑรรญร‰ร‰รคยนร”รŒรรฌรฌยกร‘ร‘ร€รจยผยฝรรรœยนร‰ร•ยฑรˆยตรกรร‰รรยฅยฝยนรŒยนยฅยนยผยฝร•รยฑยฅร‘ยฑยฅยนรŒยนยกร‘ยตยฐรญx ยธยฉlร€รครˆรญยธร€รครˆรญร‰tยฌยคร€รครˆรฌร„ยฌยผร€รŒร˜รฌร„ยฐร…ร•ยฝรรญx ยธยจยค ร€รครˆรญรˆรผร€รครˆรญยธร€รครˆรฌร„ยคยฌร€รŒร˜รฌร…ร•ยฝรรฌยฐ)1ยฝยฐร€รŒร˜รญรMร‰ยฅยฑรˆยฐร€รŒร˜รญรMร‰ยฅยฑ0รดMร‰ยฅรร‘ยฅรˆยตร€รฌร…ร•ยฝรรฌร€รครˆรญQรรยนร‘รกรร…ร•ยฝรรฌยฐร€รŒร˜รญรMร‰ยฅยฑรดMร‰ยฅรร‘ยฅรˆยตร€รฌร…ร•ยฝรรฌร€รครˆรญQรร‘IMยตยฑยฐยนร‘รกรร…ร•ยฝรรฌยฐร€รŒร˜รญรMร‰ยฅยฑ4รดMร‰ยฅรร‘ยฅรˆยตร€รฌร…ร•ยฝรรฌร€รครˆรญQรร‘I5ยฅร•ยดยนร‘รกรร…ร•ยฝรรฌ)
ยฝยนรยฝยฑ]ร‰ยฅร‘ ร…ร•ยฝรรญยฅยฑร‘Mยฅรฉ ร€รŒร˜รญรMร‰ยฅยฑยครดร…ร•ยฝรรฌยตร€รฌยฅยฑร‘Mยฅรฉ ร€รŒร˜รญรMร‰ยฅยฑยคยตร€รฌ1ยค(ร€รŒร˜รญรIรร•ยฑร‘ยฅยฑรดMร‰ยฅรร‘ยฅรˆยตร€รฌร…ร•ยฝรรฌร€รครˆรญIรร•ยฑร‘รŒยนร‘รกรร…ร•ยฝรรฌ)ยฅยฑยฑร‘ ร€รŒร˜รญรIรร•ยฑร‘ยฅยฑยค(ร€รŒร˜รญร‘ยฅยตร‰รร‘ยตร€ร„รดQยฅยตร‰%ยนยฅร ยค)1ยฝยฐร€รŒร˜รญรยฅยฑร‘รดยฅยฑI ร€รŒร˜รญรMร‰ยฅยฑยคยฐร€รŒร˜รญรยฅยฑร‘รˆรดร€รŒร˜รญรยฅยฑร‘รฌร‰ยฅยนรร•รยฅยฑรŒรยฅยนยฑรร‘ร‰ยฅยน)
ยฝยนรยฝยฑ]ร‰ยฅร‘ ร…ร•ยฝรรญIQยฅยตรดร…ร•ยฝรรฌยตร€รฌIยฝร•ยนยกQยฅยตร‰ยฅ ร€รŒร˜รญร‘ยฅยตร‰รร‘ยตร€ร„ยคยคยตร€รฌร…ร•ยฝรรฌร…ร•ยฝรรฌยตร€รฌQยตร€รฌร…ร•ยฝรรฌยตรร…ร•ยฝรรฌยตร€รฌ1ยค(ร€รŒร˜รญร‘ยฅยตร‰รร‘ยตร€รŒรดQยฅยตร‰%ยนยฅร ยค(รฌรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรด(ร€รŒร˜รญรยฅยฑร‘ร„รดMร‘ร‰ยฅยนIรกรIรยฑ ร€รŒร˜รญรยฅยฑร‘ยฐร…ร•ยฝรรฌ รฝยดยฅx ยธยจยฌยคร€รครˆรญรˆรผร€รครˆรญยธ รผรด รผรจยธยจยฌร€รครˆรญรˆรผร€รครˆรญยธยคยจรผร€รครˆรฌร„ร€รŒร˜รฌยคร…ร•ยฝรรฌยฐร…ร•ยฝรรฌร…ร•ยฝรรฌยครฌรฌร‰ร‰ยฝร‰รŒยฝร•รยฅยตร•ยฑร‘ยฅรยญร…ร•ยฝรรฌร…รรยฑยฅยนa50ร™ร‰รยฅยฝยธยฅยธยฅยฑรฌรกร‘ร‰ร…ร•ยฝรรฌยฝยฑยฅร‰
ยฝยนยฅร…ร•ยฝรรฌรยฝร‘ยฝยผ(รฌรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรดรด)
ยฝยนรยฝยฑ]ร‰ยฅร‘ ร…ร•ยฝรรญIรกร€Qยฅยตรดร…ร•ยฝรรฌยตร€รฌIยฝร•ยนยกQยฅยตร‰ยฅ ร€รŒร˜รญร‘ยฅยตร‰รร‘ยตร€รŒยคยคยตร€รฌร…ร•ยฝรรฌร…ร•ยฝรรฌยตร€รฌQยตร€รฌร…ร•ยฝรรฌยตรร…ร•ยฝรรฌยตร€รฌ1ยค(ร€รŒร˜รญร‘ยฅยตร‰รร‘ยตร€รˆรดQยฅยตร‰%ยนยฅร ยค)ยฅยฑ]ร‰ยฅร‘ ร€รŒร˜รญรIรร•ยฑร‘ยฅยฑยฐร€รŒร˜รญรยฅยฑร‘ร„ยค)
ยฝยนรยฝยฑ]ร‰ยฅร‘ ร…ร•ยฝรรญ]ร‰ยฅร‘Qยฅยตรดร…ร•ยฝรรฌยตร€รฌIยฝร•ยนยกQยฅยตร‰ยฅ ร€รŒร˜รญร‘ยฅยตร‰รร‘ยตร€รˆยคยคยตร€รฌร…ร•ยฝรรฌร…ร•ยฝรรฌยตร€รฌQยตร€รฌร…ร•ยฝรรฌยตรร…ร•ยฝรรฌยตร€รฌ1ยค)
ยฝยนรยฝยฑ]ร‰ยฅร‘ ร…ร•ยฝรรญQยฝร‘ยฐQยฅยตรดร…ร•ยฝรรฌยตร€รฌIยฝร•ยนยกQยฅยตร‰ยฅ ร€รŒร˜รญร‘ยฅยตร‰รร‘ยตร€ร„ยคยคยตร€รฌร…ร•ยฝรรฌร…ร•ยฝรรฌยตร€รฌQยตร€รฌร…ร•ยฝรรฌยตรร…ร•ยฝรรฌยตร€รฌ1ยค(รญรธ
ยฝยนรยฝยฑ]ร‰ยฅร‘ ร…ร•ยฝรรญMร‘ร‰ยฅยน5ยฅ ร€รŒร˜รญรยฅยฑร‘ร„ยฐรˆรˆร„ยฐรœร€ร€ยครดร…ร•ยฝรรฌยตร€รฌMร‘ร‰ยฅยน5ยฅ ร€รŒร˜รญรยฅยฑร‘ร„ยฐรˆรˆร„ยฐรœร€ร€ยคยตร€รฌ1ยค)
ยฝยนรยฝยฑ]ร‰ยฅร‘ ร…ร•ยฝรรฌร€รŒร˜รญรยฅยฑร‘ร„รดร…ร•ยฝรรฌยตร€รฌร€รŒร˜รญรยฅยฑร‘ร„ยตร€รฌ1ยค
Best, randall

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...