Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI!
i want to copy a txt file daily automatically from a different server( where that file is created) to my qlikview server. And then i will use that file in reloading my qlikview application. Preferably i wanna use a batch file for it. So could anyone help me on this, how to go a'bt it.
Thanks in advance..
Warm Regards,
Rahul.
create a txt file and rename the extention to cmd.
Map the driver from the other machine (cmd does not support UNC path)
right-click it and click "Edit"
Put something like this in the file:
copy z:\file.txt to c:\myfolder
Hello,
I've recently had todo something similar where I was getting text files from a network machine into QV.
I ended up making a batch file to automate the task, and used the windows tasks scheduler to run my file every evening, then QV would load the new data ready for the morning.
The freeware program i used was xxcopy.
You only really need the xxcopy line, but it was easier for me to access our server via a mapped drive letter.
Below is an example from my batch file:
net use \\192.168.1.1 /user:Admin password
//This tells my PC to use a specific username and password when trying to access my server
net use z: \\192.168.1.1\Data_Folder
//I then map my server to a local drive letter z:
xxcopy z:\ c:\QV_Data_Folder /DB:. /BI /F /V /YY /S
//Copy from z: to my C:, There are loads of options for the xxcopy program. I used:
/DB:.
files that were changed yesterday or earlier
/BI
backup incremental, new files from source to destination
/F
list output of copy to console
/V
verify file has been copied correctly
/YY
to suppress all prompts
/S
subdirectory
net use z: /delete
//Delete the network share at the end.
This worked for me, hope it helps!
Peter.
Hi! Peter Many thankx for your reply...this copy command is working fine but i am not been able to map the drive and also not been able to use NET USE Properly i think the syntax is not proper.. for eg if my user name and password is test1 and test2 the what will be the syntax and also the name of the file which i want to copy changes every day like if today it is filename17082010.txt then tomarrow it will be filename18082010.txt and so on so can you suggest something for this so that i can write it in my batch.
thankx in advance.
Warm Regards,
Rahul
Hello Rahul,
Sorry i didn't see your post (didn't get an email about it)
For completeness I'll try and answer your Q anyway.
The syntax should be for you:
net use \\192.168.1.1 /user:test1 test2
where test1 is your username, and test2 is the password for that account.
There are lots of website with syntax examples available if your having trouble.
My tip:
make sure you can access that network PC via the normal windows explorer with those details first
(like when it opens the username/password dialogue box normally when you try to access a network device. Or you can map the drive in your windows explorer and specify the username/password to use there as a test)
If the filename changes everyday (like mine did), i used the example on my last post.
This just sync'd the source folder to my local PC (one way only), so any changes or new files in the source folder were sent to my local PC.
There are so many options for that xxcopy program you'll have to study their help, but it can copy the entire folder or maybe just files that have the name filename*.txt for example.
Hope you got it working in the end!
Thanks,
Peter.