Pattern Matching: First line of text file, unknown # words

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I want to use the first line of a text file as the new name of the file.
I have this working with one error.
At the moment I create a Custom Token and use Anywhere as the contents of the token to match the pattern. As I understand from an earlier discussion since this is specified as the first occurrence it will capture the first line up to the end, which it seems to do.
Then in the actions I have simply
"Rename" with pattern "Custom Token"
Note that in the renaming I'm not adding an extension to the file.

Results:
If the first line of the text file is Link Test
then the renaming process creates "Link Text/"

Don't know why that slash is being added but is there a way to remove it?
dorich
 
Posts: 11
Joined: Thu Apr 02, 2015 3:10 pm

Is there any punctuation at the end of that line (like ':')?
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

No punctuation.
It appears that the slash is the only addition.
dorich
 
Posts: 11
Joined: Thu Apr 02, 2015 3:10 pm

Open the preview (the "eye" button). Select the file and click on its "i" button. At the bottom, it should show you the value of the custom attribute. Does the slash appear there?
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Open the preview (the "eye" button). Select the file and click on its "i" button. At the bottom, it should show you the value of the custom attribute. Does the slash appear there?


Yes
dorich
 
Posts: 11
Joined: Thu Apr 02, 2015 3:10 pm

Maybe there is some invisible character at the end that is getting translated into a slash? If the file doesn't have any sensitive info in it, if you email it in, I can take a look to see if that's the case.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Just to close off this thread for any readers:

We found that the export from OmniFocus was adding a colon. Since the colon is not an allowed character it was being changed to the "/".
I changed the rule to avoid the ":" and everything worked.
dorich
 
Posts: 11
Joined: Thu Apr 02, 2015 3:10 pm


Return to Support