Importing a file

Scott Brown lordblue at msn.com
Wed May 24 06:41:12 PDT 2006



>>Hi,
>>
>>I need to do a import on a comma delimited file into filepro 4.8. The file 
>>will be ftp'd every day and the name will be different each day. Example: 
>>20060523xact.csv one day and 20060224eact.csv the next day. I can't use a 
>>static file name because of the small chance of data loss. Is there a way 
>>to code filepro to import a file that has a different name every day 
>>without having to manually change it?
>>Below is a portion of what I had before I found out I can't use a static 
>>file name.
>>
>>1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>loop   . If: .
>>       Then: import ascii pay=usedtobestatic.file  \r=\n f=, .
>>
>>   -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>       . If: not pay .
>>       Then: end .
>>
>>   -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>       . If: .
>>       Then: 
>>a=pay(1);b=pay(2);c=pay(3);d=pay(4);e=pay(5);f=pay(6);g=pay(7);h=p>
>>
>>   -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>       . If: .
>>       Then: n=pay(14);o=pay(15);p=pay(16);q=pay(17) .
>>
>>   -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>       . If: .
>>       Then: lookup new = temppay  r=free  -e ..
>>
>>   -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>       . If: .
>>       Then: 
>>new(1)=a;new(2)=b;new(3)=c;new(4)=d;new(5)=e;new(6)=f;new(7)=g;new>
>>
>>Any help would be most appriciated!
>>
>>Thanks,
>>
>>Scott Brown
>>
>>
>
>use a cron scripts that cat all csv files received into a static filename
>
>
>
>cat *.csv >> staticfile.csv
>report blablablablabla -f blabla -blablablabla
>mv staticfile.csv static$$.old
>rm -rf *.csv
>
>
>so even if you get multiple files all will be processed.
>
Thanks, this will work great....

Scott....




More information about the Filepro-list mailing list