Skip to content

Commit

Permalink
Updated example and added RegexExtract to available functions
Browse files Browse the repository at this point in the history
  • Loading branch information
davesavic committed Aug 20, 2023
1 parent 6497cbe commit 002b450
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/destination.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id,full_name,street,city,state,postcode,country,dob
1,John Lmith,123 Something Street,Anytown,Queensland,4209,Australia,01/01/1980
2,Jane Doe,456 Something Street,Anytown,Queensland,4209,Australia,01/01/1950
3,John Doe,789 Something Street,Anytown,Queensland,4209,Australia,01/01/1970
id,full_name,street,city,state,postcode,country,dob,day,month,year
1,John Lmith,123 Something Street,Anytown,Queensland,4209,Australia,01/01/1980,01,01,1980
2,Jane Doe,456 Something Street,Anytown,Queensland,4209,Australia,01/01/1950,01,01,1950
3,John Doe,789 Something Street,Anytown,Queensland,4209,Australia,01/01/1970,01,01,1970
5 changes: 4 additions & 1 deletion examples/script.csvshift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ Column state
Column dob
-> RegexReplace "(\d{4})-(\d{2})-(\d{2})" with "$3/$2/$1"

Output Columns id, full_name, street, city, state, postcode, country, dob
Column dob
-> RegexExtract "(\d{2})\/(\d{2})\/(\d{4})" as day, month, year

Output Columns id, full_name, street, city, state, postcode, country, dob, day, month, year
1 change: 1 addition & 0 deletions listeners/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var singleColumnTransformerFactories = []transformers.SingleColumnTransformerFac
&transformers.SingleColumnUpperTransformerFactory{},
&transformers.SingleColumnSplitTransformerFactory{},
&transformers.SingleColumnRegexReplaceTransformerFactory{},
&transformers.SingleColumnRegexExtractTransformerFactory{},
}

var multipleColumnTransformerFactories = []transformers.MultipleColumnTransformerFactory{
Expand Down
4 changes: 3 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ release:
echo "Invalid release type. Use major, minor, or patch."; \
exit 1; \
fi; \
trap 'echo "Error encountered, cleaning up tags..."; git tag -d $$NEW_VERSION; git push origin :refs/tags/$$NEW_VERSION;' ERR; \
git tag -a $$NEW_VERSION -m "$(message)"; \
git push origin $$NEW_VERSION; \
goreleaser --clean;
goreleaser --clean; \
trap - ERR;

.PHONY: release

0 comments on commit 002b450

Please sign in to comment.