I am hoping that someone maybe able to help me. I need to create a regex that will remove all duplicates from a input file – I am creating a http://ftp.exe script to upload files and do not want duplicates in the execute command.
Here is a short example of the script: There might be up to 20 or more of the same duplicates in the file…
I have created ( brackets around the different parts ) and thought that it maybe used to group
(mkdir /breeds
cd /breeds
mput C:\Inetpub\wwwroot\site.co.za/admin/buckets\application\sites\site_-_org/breeds/*.*
)
(mkdir /breeds
cd /breeds
mput C:\Inetpub\wwwroot\site.co.za/admin/buckets\application\sites\site_-_org/breeds/*.*
)
(cd /
mput C:\Inetpub\wwwroot\site.co.za/admin/buckets\application\sites\site_-_org/*.*
)
(cd /
mput C:\Inetpub\wwwroot\site.co.za/admin/buckets\application\sites\site_-_org/*.*
)
How can I write a javascript regex.match to stip out the duplicate values.
One way to do it would be to combine each “group” into one line (e.g. separate the commands with semicolons), then use unix
| sort | uniqto remove duplicate lines, then split the lines back up again.