1- I tried to turn text to one array and replace them something like this:
But this code doesn't keep the new line and echo all text in one line and my text is so big about 15 Gb and can't put it in one array.
2- Choose randomly from all occurrences of one word or token in the whole text.
simply can get number of repetition by something like this ( grep "a" | wc -l )
3- I can use python to do this but my text is huge and I want to use bash since it is faster than python. In python I use a set contains (a,b) and in replace function use a random function to choose (a or b) from that set.
4- I use Ubuntu 18.04, sed (GNU sed) 4.4, GNU Awk 4.1.4, API: 1.1 (GNU MPFR 4.0.1, GNU MP 6.1.2)
5- I simplify the problem, the main problem is that: I want to normalize a text corpus for training a tri-gram language model, in the language model, the sequence of words is important. I normalize the numbers to letters so for example, I convert all 30 to thirty but we use often half instead of thirty for reporting hour (e.g 8:30). I want to replace randomly things like this not whole of them.
on my desktop i am using the kde rotating desktop image option. this rotates images randomly every half hour. now, i would like to write an html file which will have an inline frame with some text, maybe system messages, or my friends live journal thati read alot, or unix.com! however, i dont want... (1 Reply)
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)
Hi there!
I am really enjoying working with sed. I am trying to come up with a sed command to replace some occurrences (not all) in the same line, for instance:
I have a command which the output will be:
200.300.400.5 0A 0B 0C 01 02 03
being that the last 6 strings are actually one... (7 Replies)
I have a text (text.txt) and I would like to replace only the first 2 occurrences of a word (but I might need to replace more):
For example, if text is this:
CAR sweet head
hat red yellow
CAR book brown
tiger CAR cow CAR
CAR milk
I would like to replace the word "CAR" with word... (12 Replies)
I want to create a cron job randomly once a day for my site's registration.
The responsible file for registrations is a config file and I need to change the contents
twice on day (on and off)
I know the way for random cron job for example
*/n * * * * /usr/local/bin/php... (6 Replies)
Hi,
I tried to adapt bartus's solution to my problem, without success. I want to replace all the occurences of this:
with:
, where something can contain an arbitrary number of balanced parens and brakets.
Any ideas ?
Best, (1 Reply)
Hi,
(First post, please be gental!)
I have a java app that I am running on unix (centos)
But it keeps dying randomly. The times seem random from anything between 3 hours and 3 days.
I have a cronjob running to restart it when ever it dies but I would rather this happened less often.
... (2 Replies)
Hello,
This is my code:
nb_lignes=`wc -l $1 | cut -d " " -f1`
for i in $(seq $nb_lignes)
do
m=`head $1 -n $i | tail -1`
//command
done
Please how can i change it to get Get 20% of lines in File randomly to apply "command" on each line ? 20% or 40% or 60 % (it's a parameter)
Thank you. (15 Replies)
Hey,
How can i create randomly create time N times.
Suppose i want to create data for a particualr date 5 times...
Mon Jan 19 11:42:50
Mon Jan 19 19:16:40
Mon Jan 19 12:12:33
Mon Jan 19 14:26:27
Mon Jan 19 12:29:53
Mon Jan 19 13:30:31
I want the script to create N times randome... (2 Replies)
Discussion started by: jaituteja
2 Replies
LEARN ABOUT DEBIAN
plmtex
PLMTEX(3plplot) PLplot API PLMTEX(3plplot)NAME
plmtex - Write text relative to viewport boundaries
SYNOPSIS
plmtex(side, disp, pos, just, text)
DESCRIPTION
Writes text at a specified position relative to the viewport boundaries. Text may be written inside or outside the viewport, but is
clipped at the subpage boundaries. The reference point of a string lies along a line passing through the string at half the height of a
capital letter. The position of the reference point along this line is determined by just, and the position of the reference point rela-
tive to the viewport is set by disp and pos.
Redacted form: General: plmtex(side, disp, pos, just, text) Perl/PDL: plmtex(disp, pos, just, side, text)
This function is used in examples 3,4,6-8,11,12,14,18,23,26.
ARGUMENTS
side (const char *, input)
Specifies the side of the viewport along which the text is to be written. The string must be one of: b: Bottom of viewport, text
written parallel to edge. bv: Bottom of viewport, text written at right angles to edge. l: Left of viewport, text written parallel
to edge. lv: Left of viewport, text written at right angles to edge. r: Right of viewport, text written parallel to edge. rv:
Right of viewport, text written at right angles to edge. t: Top of viewport, text written parallel to edge. tv: Top of viewport,
text written at right angles to edge.
disp (PLFLT, input)
Position of the reference point of string, measured outwards from the specified viewport edge in units of the current character
height. Use negative disp to write within the viewport.
pos (PLFLT, input)
Position of the reference point of string along the specified edge, expressed as a fraction of the length of the edge.
just (PLFLT, input)
Specifies the position of the string relative to its reference point. If just=0., the reference point is at the left and if
just=1., it is at the right of the string. Other values of just give intermediate justifications.
text (const char *, input)
The string to be written out.
AUTHORS
Geoffrey Furnish and Maurice LeBrun wrote and maintain PLplot. This man page was automatically generated from the DocBook source of the
PLplot documentation, maintained by Alan W. Irwin and Rafael Laboissiere.
SEE ALSO
PLplot documentation at http://plplot.sourceforge.net/resources.
August, 2012 PLMTEX(3plplot)