File name changes constantly, but it always starts with Currency1 and Currency2. I have found :echo TEST >> C:\TEST\currency1.csv
This is correct but the file name is changing constantly. If the file name is today currency1.11302012.csv for tomorrow it's currency1.01122012.csv . i need a code that's look only to the beginning of the file.
From your post it is not clear what you want to achieve. If your purpose is to retrieve the files whose name starts with Currency1 you can use wild characters as Currency1.????????.csv. Anyway to access a specific file you need to specify its full name.
If i have 2 files.
currency1.11302012.csv
currency2.11302012.csvi have to add each day a text on the bottom.
but each day the files are changed.for tomorrow
currency1.12012012.csv
currency2.12012012.csv
than i have to add the same text in the files.
If each day in your folder you have just the two files to be updated, then
for %%j in (currency?.????????.csv) do @echo.text to be inserted>> %%j
The above line applies to a batch, i.e. the command is stored in a .bat file, however if issued at prompt replace %%j with %j.
Thank you very much. at least i have found what i wanted to make. For people in the future who needed help with this. I will past the script here. maybe i can help some one with it. ren C:\blp\bbdl\_csv\* *?.csv
PING 127.0.0.1 -n 6
for %%j in (C:\blp\bbdl\_csv\dailycurrency1.out.????????.csv) do @echo.TEST EUR>> %%j
PING 127.0.0.1 -n 6
for %%j in (C:\blp\bbdl\_csv\dailycurrency2.out.????????.csv) do @echo.TEST >> %%j
PING 127.0.0.1 -n 6
powershell -command "& 'C:\NewScript\copy_script_PS.ps1' "
