-   Programming (
-   -   Script for split file (

petrw1 2022-05-11 05:46

[QUOTE=pepi37;605586]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)


Like [URL=""]this[/URL] does?
Maybe you can access the source.

pepi37 2022-05-11 07:53

for i in `seq 1 $N`; do
echo '[Worker #'$i']'; awk 'a++%'$N'=='$i'-1' input.txt
done > output.txt [/CODE][/QUOTE]

I made two scripts, one for 8 worker one for 12 worker

All times are UTC. The time now is 07:25.

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