Sign in to follow this  
Followers 0
Hypnotik

Transporting letters to another file with filter

6 posts in this topic

Hey :)

i'd like to read a txt file containing letters, and i want to move them into another txt file, but to move only the words that dont contain a "-" and that are smaller than 6 letters

is that possible?

Share this post


Link to post
Share on other sites

Yes is Posible.

Example of the file?

Share this post


Link to post
Share on other sites

I don't see any "-"  I think you Mean "_"

Share this post


Link to post
Share on other sites

I don't see any "-"  I think you Mean "_"

Yep sorry i meant _

Share this post


Link to post
Share on other sites

maybe not the most efficient way but it should work.

#include <Array.au3>
#include <File.au3>


Local $Data=FileRead("au.txt")

$Data=StringRegExpReplace($Data,"[A-Za-z_]{6,}",".")
$Data=StringRegExp($Data,"[A-Za-z]{1,5}",3)

_ArrayDisplay($Data)

_FileWriteFromArray("newau.txt",$Data)

Saludos

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0