1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I Perform This Simple Macromanagement Task?

Discussion in 'BlackHat Lounge' started by Noah Hawryshko, Oct 15, 2016.

  1. Noah Hawryshko

    Noah Hawryshko Senior Member

    Joined:
    Apr 28, 2016
    Messages:
    869
    Likes Received:
    723
    Gender:
    Male
    Occupation:
    Biotechnology Engineer at Silph. Co, Saffron
    Location:
    Kanto
    Hi BHW,

    So I want to be able to put a bunch of lines of text into a text box, click and button, and then have the text box delete every line that is not "x" amount of characters or more long.

    Does anybody have a go-to solution for this?
     
  2. KraftyKyle

    KraftyKyle Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    Aug 13, 2008
    Messages:
    2,033
    Likes Received:
    4,800
    Gender:
    Male
    Location:
    Unknown
    Change '2048' to whatever your "x" amount of characters is:
    Code:
    sed '/^.\{2048,\}$/d' file.in >file.out
    I just tested it and it does the trick. Here's the source if you're interested.
     
  3. redarrow

    redarrow Elite Member

    Joined:
    Apr 1, 2013
    Messages:
    4,286
    Likes Received:
    979
    So you want to write a set amount charecters but when the button presed if it not the deafualt amount of characters there deleted.

    Example

    Ased bbvh jjhh ghjj

    But it entered

    Derftgyhjuu bhjuyfdrf nhgftthj

    Going mad forget me lol
     
  4. uncutu

    uncutu Supreme Member

    Joined:
    Aug 6, 2010
    Messages:
    1,455
    Likes Received:
    679
    1) put it all in excel/notepad++ (with textfx plugin)
    2) sort the list
    3) highlight everything above/below your character limit
     
  5. tasburrfoot

    tasburrfoot Regular Member

    Joined:
    Dec 16, 2008
    Messages:
    323
    Likes Received:
    152
    <php
    $length = 10;

    If(isset($_post['submit'])){

    $words = explode(',' $_post['textbox']);
    Foreach($words as $word){
    If(strlen($word) > $length){
    Echo $word;
    }
    }
    }else{
    Echo('
    <form action="checkword.php" method="post">
    <input type="textarea">
    <input type="submit" value="submit>
    </form>
    ');
    }
    ?>


    Save that as checkword.php separate each word with a , go hard. Adjust length in the "$length = 10;" line.