cut first 10 lines of file master.txt and paste in ab1.txt and so on
Hello,
I have a file called master.txt containing 1000 lines. I want to cut first 10 lines of master.txt and paste in data1.txt then submit a job using command "bsub -K -qio ./run1.txt", when this job is finished, cut first 10 lines of master.txt and paste (replace) in data1.txt (lines should be overwritten, i mean old 10 lines of data1.txt should be deleted and new lines should be paste) and submit "bsub -K -qio ./run1.txt" and so on. run1.txt contains a single command "./mod.sh data1.txt . >& zlog1.txt" Total there should be 100 iterations as there are 1000 lines in master.txt Please reply if anybody know. Thanks. |
See:
http://www.grymoire.com/Unix/Sed.html#uh-30 Examples: Code:
sed -n '1,10 p' test > new |
Does LSF support array jobs? In GridEngine aka SGE I would submit one array job running 100 instances and depending on the index $SGE_TASK_ID you get for each job it could honor the relevant lines of the master.txt file. The problem I see with your solution is, that you would need either 100 different data1.txt files, or to wait with the next job until the predecessor finished (to avoid overwriting of the previous data1.txt file).
Aha, LSF has the variable LSB_JOBINDEX, so: Code:
#!/bin/sh |
Thanks Reuti,
It didnt work. I have a code like Code:
#!/bin/sh |
Well, the problem is the pipe, as it won’t get any input - the output is already redirected.
Also the computation of i is not working - the i will be set to a literal [i+1] as text. Code:
for ((i=1;i<=3991;i+=10)); do |
All times are GMT -5. The time now is 09:27 AM. |