Use a variable in an export path
Bruce Easton
bruce at stn.com
Mon Apr 20 13:18:02 PDT 2015
Josh - after further testing, it seems filepro doesn't need extra quotes
around dir names that have spaces (and errors out when they are
supplied). Internally, filepro might see that part of a path needs
extra quoting for exports and supplies them (internally). So,
regardless of whether your dir names have spaces or not, on both unix
and centos filepro 5.0.14, my tests show that the following works:
fn="/appl/user_exports/users/"{nm{"/filepro/export.txt"
But watch out for:
1. nm should be declared
2. check perms on dirs that filepro need to write to
Bruce
On 4/20/15 3:45 PM, Bruce Easton wrote:
> Hi Josh,
>
> 1. Did you declare dummy field "nm"? If not you need to declare it.
> I just tested the code I posted on 5.0.14, and it did not error when
> "nm" was declared, for instance, as (100,*).
>
> 2. What version of filepro are you testing with?
>
> Also - your replies to the forum (subject) make it look as though
> you're starting a new topic each time.
>
> Bruce
>
>
> On 4/20/15 3:35 PM, Josh Reader wrote:
>> Hi Bruce,
>>
>>
>>
>> Yes nm is a filePro dummy field and it will have a space because it will
>> have a first name, a space, and then a last name. I tried both of your
>> suggestions below but I cannot save the output processing as I get an
>> error
>> about the syntax.
>>
>>
>>
>> Here is what I tried and the error I received when checking the
>> syntax on
>> save:
>>
>>
>>
>> Suggestion 1
>>
>> fn="/appl/user_exports/users/\""{nm{"\"/filepro/export.txt"
>>
>>
>>
>> Result:
>>
>> *** A filePro Error Has Occurred ***
>>
>>
>>
>> Line Number: 36
>>
>>
>>
>> fn="/appl/user_exports/users/\""{nm{"\"/filepro/export.txt"
>>
>> ^
>>
>> Process contains a syntax error at position indicated.
>>
>>
>>
>>
>>
>> Suggestion 2
>>
>> fn="/appl/user_exports/users/'"{nm{"'/filepro/export.txt"
>>
>>
>>
>> Result:
>>
>> *** A filePro Error Has Occurred ***
>>
>>
>>
>> Line Number: 36
>>
>>
>>
>> fn="/appl/user_exports/users/'"{nm{"'/filepro/export.txt"
>>
>> ^
>>
>> Process contains a syntax error at position indicated.
>>
>>
>>
>> When using the system command in filePro (which passes things off to the
>> Linux command line) I believe this syntax would work perfectly but since
>> it's being used with the export command does that require a different
>> syntax?
>>
>>
>>
>> Thanks for your assistance,
>>
>> Josh
>>
>>
>>
>>
>>
>>
>>
>> I'm assuming that "nm" is a filepro dummy field. Base on that you
>>
>> simply need:
>>
>>
>>
>> fn="/appl/user_exports/users/"{nm{"/filepro/export.txt"
>>
>>
>>
>> However, since you mention "nm" have values representing names, I'll
>> also
>> assume that your "name" directory names may have spaces in them. If
>> that's
>> true, then you'll need quotes around what may have spaces, and since it
>> would be in this string, you would need to backslash those double-quotes
>> (for filePro interpretation):
>>
>>
>>
>> fn="/appl/user_exports/users/\""{nm{"\"/filepro/export.txt"
>>
>>
>>
>> I'm not sure this works across all *nix, but using single quotes
>> (instead
>> of backslashed doubles) also worked for me on one unix box:
>>
>>
>>
>> fn="/appl/user_exports/users/'"{nm{"'/filepro/export.txt"
>>
>>
>>
>> But you definitely need double quotes up against the braces
>> surrounding the
>> dummy field for filepro to understand how to concatenate the string.
>>
>>
>>
>> Bruce
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> <http://mailman.celestial.com/pipermail/filepro-list/attachments/20150420/bc43bf99/attachment.html>
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
More information about the Filepro-list
mailing list