Combine them into one line of two things with paste, shuffle them with shuf, separate them out into two files again. I've done it with awk but you could do it many ways.
Your output files shouldn't be the same as your input files. If you need it to be, just rename the new files overtop of the old.
Hi,
From some time, we have noticed that our ascii files have started corrupting due to the presence of some random control characters (^@, ^M, ^H, ^D). The characters appear randomly on any file after the process that creates the file finishes. If we rerun the process, the files re creates... (0 Replies)
I have a directory of files that look like filename 001.ext, filename 002.ext, etc. I'd like to rename the files with unique random numbered names, so that the original filenames are stripped and the files are given a new, random number name. I'm not super new to UNIX, but I don't often use it for... (2 Replies)
hello
i just seeking for a simple way to make a shuffle by block of words in a line. no matter shell (sh/bash) or perl
should be like this:
the message (which is line of some file) splits to packs (packs are random 5-10 words in each) then making a new line inserting those packs in a random... (9 Replies)
I have a text file with 1000 lines, I want to randomly select 200 lines from it and print them as output. How do I go about doing that? Thanks! (7 Replies)
I have two files containing hundreds of different sequences with the same Identifiers (ID-001, ID-002, etc.,), something like this:
Infile1:
ID-001 ATGGGAGCGGGGGCGTCTGCCTTGAGGGGAGAGAAGCTAGATACA
ID-002 ATGGGAGCGGGGGCGTCTGTTTTGAGGGGAGAGAAGCTAGATACA
ID-003... (18 Replies)
Is there any way to place each even column name infront of its odd column using awk or others?
input
Ab name MGH26 B04 MGH26 B05
output
name_Ab B04_MGH26 B05_MGH26 (4 Replies)
Hi Folks,
I have a text file with a thousand lines consisting of words or a group of words separated by commas.
I would like to randomize / shuffle the words on each line.
Eg; file.txt
Linux,Open,Free,Awesome,Best Things in Life,The Greatest
Laptop,PC,Tablet,Home Computers,Digital... (2 Replies)
Hi,
Is there any way I can shuffle the numbers randomly. I have been trying to google and I found lots of 'generator' but is it possible to find the background logic to create randomness?
Thanks, (3 Replies)
DBIx::Class::Storage::DBI::Replicated::Balancer::Random(User Contributed Perl DocumentatDBIx::Class::Storage::DBI::Replicated::Balancer::Random(3)NAME
DBIx::Class::Storage::DBI::Replicated::Balancer::Random - A 'random' Balancer
SYNOPSIS
This class is used internally by DBIx::Class::Storage::DBI::Replicated. You shouldn't need to create instances of this class.
DESCRIPTION
Given a pool (DBIx::Class::Storage::DBI::Replicated::Pool) of replicated database's (DBIx::Class::Storage::DBI::Replicated::Replicant),
defines a method by which query load can be spread out across each replicant in the pool.
This Balancer uses List::Util keyword 'shuffle' to randomly pick an active replicant from the associated pool. This may or may not be
random enough for you, patches welcome.
ATTRIBUTES
This class defines the following attributes.
master_read_weight
A number greater than 0 that specifies what weight to give the master when choosing which backend to execute a read query on. A value of 0,
which is the default, does no reads from master, while a value of 1 gives it the same priority as any single replicant.
For example: if you have 2 replicants, and a "master_read_weight" of 0.5, the chance of reading from master will be "20%".
You can set it to a value higher than 1, making master have higher weight than any single replicant, if for example you have a very
powerful master.
METHODS
This class defines the following methods.
next_storage
Returns an active replicant at random. Please note that due to the nature of the word 'random' this means it's possible for a particular
active replicant to be requested several times in a row.
AUTHOR
John Napiorkowski <john.napiorkowski@takkle.com>
LICENSE
You may distribute this code under the same terms as Perl itself.
perl v5.18.2 2013-07-12 DBIx::Class::Storage::DBI::Replicated::Balancer::Random(3)