How do I Perform This Simple Macromanagement Task?

Noah Hawryshko

Senior Member
Joined
Apr 28, 2016
Messages
901
Reaction score
891
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?
 
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.
 
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
 
1) put it all in excel/notepad++ (with textfx plugin)
2) sort the list
3) highlight everything above/below your character limit
 
<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.
 
Back
Top