> On Jul 30, 2015, at 18:00, Mohamed Noor <[email protected]> wrote: > > Dear all > > I have about 70 folders of data collected at Diamond. As I only want to keep > about 50 of them, is there a script that can read in the folder names from a > text file and download those? > > Normally, I use FileZilla but it gets tedious to click so many times after a > while….
If diamond allows ssh-access, one way is $ ssh [email protected] '( cd your/directory ; tar -cpf - `cat list.txt` )' | tar -xvpf - where user is your username, host.diamond is the machine at diamond, your/directory is the path to where your stuff is stored, and list.txt is a file in your/directory with the files and directories you want transferred. > Secondly, some folders have one sweep of data, some others with two or even > three, is it possible to run a command from terminal that will filter > different sweeps and output the number of frames? > > For example, in a folder with files: > > xxxx_sweep1_0001.cbf - xxxx_sweep1_1800.cbf > xxxx_sweep2_0001.cbf - xxxx_sweep2_0900.cbf > > I want to get a text file output containing a line saying: > /folder/name/sweep1 - 1800 > /folder/name/sweep2 - 900 Would $ ls folder/name/*.cbf | sort | sed -e "s:_....\.cbf$::" | awk -vi=0 '{ if ($0 == prev) { i++; } else { print $0 " - " i + 1; i = 0; prev = $0;} }' do the trick? > The idea is so that I can feed those lines into XDS.INP without checking how > many sweeps there are in each folder and how many frames. > > I'm pretty sure someone on the BB has a trick for this. Research Specialist @ Gonen Lab ____________________________________________________ Janelia Research Campus * 19700 Helix Drive Ashburn, VA 20147 * +1 (571) 209-4000 extension 3376
