mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2022-05-11, 05:46   #12
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

2·32·172 Posts
Default

Quote:
Originally Posted by pepi37 View Post
I need script that will "ask" me number of workers and then split input file equally into worktodo.txt file ( and if possible add "Worker line") ( in this case 3 workers)





Thanks
Like this does?
Maybe you can access the source.
petrw1 is online now   Reply With Quote
Old 2022-05-11, 07:53   #13
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

3×7×73 Posts
Default

Quote:
Originally Posted by Batalov View Post
bash
Code:
N=3
for i in `seq 1 $N`; do 
  echo '[Worker #'$i']'; awk 'a++%'$N'=='$i'-1' input.txt
 done > output.txt



Perfect!
I made two scripts, one for 8 worker one for 12 worker
Thanks!
pepi37 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH script segment won't work in larger script EdH Programming 41 2021-10-15 22:07
CADO-NFS vs GGNFS and other NFS considerations [split from New Factoring Algorithm] Dubslow Factoring 6 2018-04-27 19:56
split a prime95 queue & client installation joblack Information & Answers 1 2009-01-06 08:45
Formula split up JHansen Homework Help 4 2007-11-20 15:02
New theorem to split LL tests(Published) nuggetprime Miscellaneous Math 9 2007-05-23 13:47

All times are UTC. The time now is 05:09.


Thu Jul 7 05:09:31 UTC 2022 up 84 days, 3:10, 0 users, load averages: 1.43, 1.68, 1.54

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔