How do I open password protected file using UiPath? - uipath

I am using UiPath to create a robot to get files from email. Some files are password protected and some files are not protected.
The password-protected files are sent in with a password in email body.
Example email
From: ABC <abc#outlook.com>
Sent: Monday, 5 October 2020 10:54 AM
To: BCD <bcd#outlook.com>
Subject: Files
The password is: ......
There can be 10 emails and 2 have password-protected files do I let the robot know which files are password protected and to open the password-protected Excel file and move the data to a mega Excel sheet containing all the files from the 10 emails.
I am unsure of the activities to put in the workflow to perform these functions.
I am also unsure if the below method I did is the right way to approach this.

This is just one option you have. As I had good experiences in the past with the BalaReva.Excel.Activities, maybe it's worth to be tested by you.
So as the image shows, this Connect comes with plenty of Libraries. You need to download the whole package and take the functionality ProtectUnProtectSheet. That activity should work on your case.
For a full example check out this.

I'm not sure at what step of your flow you are having problems with, but here are a few pointers on some of the things you need to do after you manage to iterate through each email (which you seem to be doing already):
to extract passwords from email bodies. You could do two things here: either apply a Regex directly on the string with the content (if you are confortable writing a few 1-2 line of vb.net code) or you go the long route of using IntelligentOCR package, Digitize the text (you will have to write it to a file first), extract the data using "Extraction Scope" and "Regex Extractor", and take it from the results json with extracted data
open Excel and use the password: there is a package called UIPath.Activities.Excel that can do this.

Did you try to get System.Net.Mail.MailMessage.Body (https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.mailmessage.body?view=netcore-3.1) and parse the string to search the password? So in your for each loop, you can use "mail.Body" and retrieve all email text.

Related

What is the required file format for Google AutoML Datasets?

Whenever I try to upload my dataset to the AutoML Natural Language Web UI, I get the error
Something is wrong, please try again.
The documentation is not very insightful about how my CSV file is supposed to look, but I tried to make a simple sample file just to make sure it works at all, it looks like this:
text,label
asdf,cat
asodlkao,dog
asdkasdsadksafask,cat
waewq23,cat
dads,cat
saiodjas,cat
skdoaskdoas,dog
hgfkgizk,dog
fzdrgbfd,cat
otiujrhzgf,cat
vchztzr,dog
aksodkasodks,dog
sderftz,dog
dsoakd,dog
qweqweqw,cat
asdqweqe,cat
dkawosdkaodk,dog
ewqeweq,cat
fdsffds,dog
bvcghh,cat
rthnghtd,dog
sdkosadkasodk,cat
sdjidghdfig,cat
kfodskdsof,dog
saodsadok,dog
ksaodksaod,dog
vncvb,cat
I chose this formatting according to the Google suggested Syntax
But even with this formatting I still get the same error
I've seen this question Format of the input dataset for Google AutoML Natural Language multi-label text classification but according to the answers there it seems my formatting should work, so I do not know why I get the error
I've just copied the CSV file and uploaded it to my own project and the dataset created worked. One problem is that an extra label was created "label" - this is because the header is not expected to be in the csv file (probably this should get fixed).
Based on that it seems the problem isn't the CSV file format. I would recommend to check if your project is setup correctly. You can open a bug to get someones help. Either you can open a bug in public issue tracker or send feedback using the UI (there is 'Feedback' option in the menu on top right side of the page).
I have found the problem! As Michal K said, there was nothing wrong with the formatting, the real problem was I was not assigned the role of Storage Object Creator, which is necessary because the Data is uploaded in Cloud Storage first

Create Multiple Slides from a List with Common Template

I have created a certificate design with powerpoint.
Now I have to create 100+ copies of it... each with a different name (the recipent).
I was wondering if there was an easy way to do it...
I can have the list of names in excel or txt.
I am open to other ideas as well, like changing the slide into an images and batch processing it in a simple way
You may also try out SlideMight, a tool for merging hierarchical data with PowerPoint templates. SlideMight supports iteration over data, to generate slides or to populate tables. There is more functionality, but you don't seem to need that. SlideMight is in fact a coding system, like mail merge for Word is.
Input data format is at this time just JSON; you would need to convert your Excel sheets first, e.g. using this Excel to JSON add-in for Excel.
There are versions for Windows and Mac OS X.
More information is at www.SlideMight.com
Disclaimer:
I am the owner of Delftware Technology, the company that developed SlideMight.
And I am one of the developers.
This is a question that really belongs in SuperUser, not StackOverflow (which is intended for coding questions, not software how-to-use questions).
But ...
Save your names to a plain notepad TXT file, one name per line.
Start PowerPoint, choose File, Open and point to your TXT file (you may force the matter by choosing . in Files of type:
Apply whatever template you like to the result.
I have a commercial add-in that'll do this and quite a bit more, but from your description, you don't need it.

automatic copy paste from Browser to Microsoft Word

I want to copy some specific texts from internet browser(chrome) and want to paste them in proper fields of Microsoft word.. Let me explain what I want exactly... I have this kind of page structure in chrome-
Name-Deepak,Raju,Jhon,Robert.......
Salary-200,254,673,953...
Phone-987535747,856889479,64688539,357954228....
Etc..
I have a table in MS word as-
Sl. Phone. Name. Salary.
Can I make a auto copy paste program to make my table-
Sl. Phone. Name. Salary
1. 987535747. Deepak. 200
2. .......
Like this? Suggest me the best suitable platform to compile this.. Its best for me, if a bat file can do the job.. I know bit odd question.. And I should not ask the entire program,rather a section of it..Bt still....... actually I don't know from where to start..
Rather than use a wget which will only retrieve the document, what you want is a way of parsing the results of the web content and writing into an output file.
After searching the web, I could only come across
lynx which
is a text based browser and you can parse the -dump parameter to
output the text into file which you can then write a script to do
the final bit.
Also take a look at this
link
for more info on switches you can use most especially if the desired
text has links in it (-nolist)
elinks which is an advanced text based browser

Is there a part of a windows file that can't be modified?

I'm trying to accomplish something that will let a user download a file from a web application onto their system. The file will contain a unique five digit code. Using this unique five digit code the users can search for a file in their file system.
I'm wondering where is the best place to put this five digit code in a file so that users can easily search for the file. The simplest approach would be to put it in the name of the file, however, users can change the name of the file easily.
I'm looking for a filed where I can put the code so that users won't be able to modify it but will still be able to search for it. Is this possible?
If you say File.. what kind of file format do you mean. I'm asking because a file is just a pile of bytes and you can append your 5 digit code every where in the file, if it is your own file format. But if you tell us which file format you use, probably there are some fields which can be used to search for it. As example Tiff has many tags. Images have other meta data. etc

Check well formatted email address

I have a text file of e-mails like this:
10:info#example.com;dev#example.com
12:john#host.com; "George <g.top#host.com>"
43:jim.p#web.com.;sue-allen#web.com
...
I want to check whether the list contains well formatted entries. Do you know any tool or web-service to check and give me a list of invalid addresses?
Update Dear all, thank you for your input. I was really looking for a basic syntax check, so I will stay with Rafe's idea (I will do it with Java).
Read this so you are doing it the RFC compliant way:
http://www.eph.co.uk/resources/email-address-length-faq/
Probably the simplest way to validate an email is to send a message to it. As Sean points out this can leave you open to DoS attacks, but from your description it seems you have a text file rather than a web page, so this shouldn't be a problem.
Regular expressions are not a good tool for matching emails, there are a lot of valid addresses that naive matching will fail. Check out this comparison of attempts to validate emails with regex for details.
If you have to check them offline, I would split the email into parts (i.e. the parts before the # and after the #), you could then create a custom validator (or regex) to validate those parts.
Email validation is not as simple as a regular expression
First, I would read this article I Knew How To Validate An Email Address Until I Read The RFC.
Back in the days of yore, you could just connect to the user's mail server and use the VRFY command and verify that an email address was valid, but spammers abused that privilege and we all lost out.
Now, I would recommend a three part approach:
Verify the syntactic validity. You can use the monster regex from the Mail perl module to check to make sure that the email address is well formed. Then make sure to blacklist localhost domains/ips as part of your check.
Verify that the domain is live. Do a DNS validation check on the domain. You could take this one step further and use a STMP check and make sure that you can connect to a valid mailserver for the domain. However, there may be some false negative results due to virtual hosting schemes.
Send an actual email, but include a single image that links to a script on your server. When the email is read with the image, your server will be notified that the image was download and hence the email is alive and valid. However, nowadays many email clients do not load images by default for this very reason, so it won't be 100% effective.
Resources
Validating Email Addresses in ASP (online)
Validating Email Addresses in PHP (code examples)
This commercial product does bulk email verification ← This is probably what you are looking for
SO Question: How to check if an email address exists without sending an-email
I wrote a simple Perl script that uses the Email::Address module to validate these addresses:
#!/usr/bin/env perl
use Email::Address;
while (<>) {
chomp;
#addresses = split /\;/;
foreach my $address (#addresses) {
if (!Email::Address->parse($address)) {
print $address, "\n";
}
}
}
You'll just need to install the module. Its home page is:
http://emailproject.perl.org/wiki/Email::Address
This problem is harder than it appears. When faced with it, I stole the code from the mf.c module in the NMH sources. I then imported the address parser into Lua so I could handle email addresses from scripts.
Using somebody else's code saved me a world of pain.

Resources