Skip to content

L3v3L/wacro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wacro

String macro operations

wacro is a commandline program that can run multiple string operations on text files .

#Commands

syntax: f or find
parameters: takes a find query string as a parameter
description: finds all occurences of a find query and selects them all

examples:

main.py -i "hello dave" -c "[f=ll]"
1 - selects the ll in the word hello

syntax: r or replace
parameters: takes the string to overwrite selections as parameter
description: replaces all selections with a string

examples:

main.py -i "hello dave" -c "[f=ll,r=y]"
1 - selects the ll in the word hello
2 - replaces them with a y, giving the result "heyo dave"

syntax: ss or start
parameters: takes no parameters
description: This will shrink the selected region to its start position

examples:

main.py -i "hello dave" -c "[f=ll,ss,r=y]"
1 - selects the ll in the word hello 
2 - selects the first l
3 - replaces the l with a y, giving the result "heylo dave"

syntax: se or end
parameters: takes no parameters
description: This will shrink the selected region to its last position

examples:

main.py -i "hello dave" -c "[f=ll,se,r=y]"
1 - selects the ll in the word hello 
2 - selects the last l
3 - replaces the l with a y, giving the result "helyo dave"

syntax: ms or move
parameters: takes an amount of postions to move
description: move each selected region by a certain amount. positive numbers go right, negative numbers go left

examples:

main.py -i "hello dave" -c "[f=h,ms=1,r=y]"
1 - selects the h in the word hello 
2 - moves the selected region to now point at the next letter,
	which is the e in the word hello
3 - replaces the e with a y, giving the result "hyllo dave"

syntax: es or expand
parameters: takes the amount of postions to expand
description: expands the selected region by a certain amount, using postive numbers will expand region, using negative number will contract region

examples:

main.py -i "hello dave" -c "[f=ll,es=1,r=i]"
1 - selects the ll in the word hello 
2 - expands the selected region to now include the e before the ll
	and the o that leads the ll
3 - replaces the ello with a i, giving the result "hi dave"

syntax: fi or inside
parameters: takes a find query string as a parameter
description: finds all occurences of a find query in all selected regions and selects them all

examples:

main.py -i "hello dave" -c "[f=hello,fi=ll,r=y]"
1 - selects the word hello 
2 - selects the ll in the word hello
3 - replaces them with a y, giving the result "heyo dave"

syntax: sl or line
parameters: takes no parameters
description: selects the whole line of each selected region

examples:

main.py -i "hello dave\nhow are things" -c "[f=how,sl,r=sup]"
1 - selects the word how
2 - selects the whole line where how is located
3 - replaces the whole line with sup, giving the result "hello dave\nsup"

syntax: ps or print_selection
parameters: takes no parameters
description: prints the current selection to console

examples:

main.py -i "hello dave\nhow are things" -c "[f=how,ps,sl,ps,r=sup]"
1 - selects the word how
2 - prints out the word how
3 - selects the whole line where how is located
4 - prints out the whole line how are things
5 - replaces the whole line with sup, giving the result "hello dave\nsup"

About

String macro operations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages