Sponsored Content
Top Forums UNIX for Advanced & Expert Users Select the ranodm percent of the line in the data set Post 302853497 by spacebar on Saturday 14th of September 2013 03:29:56 PM
Old 09-14-2013
I believe this info will do it for you, check it out:
https://www.unix.com/shell-programmin...-randomly.html
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture two set of data to same line...simple

I would like to capture output from two commands to a test file on the same line... I want to get a file with all Applications and the Version of it...here are the two commands I use to get the output. To get Application list I use ls -1 /Applications/ |grep .app >>... (3 Replies)
Discussion started by: elbombillo
3 Replies

2. Shell Programming and Scripting

In a csh script, can I set a variable to the result of an SQLPLUS select query?

Can someone tell me why I'm getting error when I try to run this? #!/bin/csh -f source ~/.cshrc # set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus # set count=`$SQLPLUS -s ${DB_LOGIN} << END select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;... (7 Replies)
Discussion started by: gregrobinsonhd
7 Replies

3. Shell Programming and Scripting

select data from list

Hi! My data file contains a two columns list. It looks like: 1 3.789 2 6.789 3 7.890 4 8.900 5 6.789 6 1.987 7 10.987 8 2.987 9 0.987 I would like to create a new list using the awk command, just selecting data from the second column but also printing the first column. Let say I select... (3 Replies)
Discussion started by: cris48
3 Replies

4. Shell Programming and Scripting

Select lines in which column have value greater than some percent of total file lines

i have a file in following format 1 32 3 4 6 4 4 45 1 45 4 61 54 66 4 5 65 51 56 65 1 12 32 85 now here the total number of lines are 8(they vary each time) Now i want to select only those lines in which the values... (6 Replies)
Discussion started by: vaibhavkorde
6 Replies

5. Shell Programming and Scripting

Select data from a file

Hi , I want to select data from a file .the datas in a file will be in both upper and lower case. can able to select particular data using awk. file is like Ram Selva 24332 UNIXTEAM Karthi Siva 43322 UNIXTEAM In read if i enter selva as lowercase its not displaying result. (9 Replies)
Discussion started by: boopal
9 Replies

6. UNIX for Dummies Questions & Answers

Command line / script option to filter a data set by values of one column

Hi all! I have a data set in this tab separated format : Label, Value1, Value2 An instance is "data.txt" : 0 1 1 -1 2 3 0 2 2 I would like to parse this data set and generate two files, one that has only data with the label 0 and the other with label -1, so my outputs should be, for... (1 Reply)
Discussion started by: gnat01
1 Replies

7. Shell Programming and Scripting

awk : Filter a set of data to parse header line and last field of multiple same match.

Hi Experts, I have a data with multiple entry , I want to filter PKG= & the last column "00060110" or "00088150" in the output file: ############################################################################################### PKG= P8SDB :: VGS = vgP8SOra vgP8SDB1 vgP8S001... (5 Replies)
Discussion started by: rveri
5 Replies

8. UNIX for Dummies Questions & Answers

Using grep to select data from file

Hello all, Once again I need to call upon the masters for help. I have a file called endpoint_data. IN that file I have groups of endpoints. However all I need from the file is this.... ENDPOINT NAME = SIPWOODSBC SIG PRI FQDN/IP ADDRESS/DOMAIN NAME = 10.xxx.xxx.xxx SIG SEC... (4 Replies)
Discussion started by: jay11789
4 Replies

9. Shell Programming and Scripting

awk to select 2D data bins

I wish to use AWK to do something akin: Select all 2D data with 1<$1<2 and -7.5<$2<-6.5 But it's not working awk 'END {print ($1<=2&&$1>=1&&$2<=-6.5&&$2>=-7.5)}' bla Data: -1.06897 -8.04482 -61.469 -1.13613 -8.04482 -61.2271 -1.00182 -8.04482 -61.2081 -1.06897 -8.13518 -60.8544... (2 Replies)
Discussion started by: chrisjorg
2 Replies
uniq(1) 						      General Commands Manual							   uniq(1)

NAME
uniq - report repeated lines in a file SYNOPSIS
fields] chars] [input_file [output_file]] DESCRIPTION
reads the input text file input_file, comparing adjacent lines, and copies the result to output_file. If input_file is not specified, the standard input and standard output are used. If input_file is specified, but output_file is not, results are printed to standard output. input_file and output_file must not be the same file. Line-Comparison Options recognizes the following options when comparing adjacent lines: Print those lines that are repeated in the original file. Print copy only of each repeated line in the input file. Generate an output report in default style except that each line is preceded by a count of the number of times it occurred. If this option is specified, the and options are ignored if either or both are also present. If none of the options or are present, prints the results of the union of the and options, producing a copy of the original input file with the second and succeeding copies of any repeated lines removed. (Note that repeated lines must be adjacent in order to be found -- see sort(1)). Field-Skip Options Two options are provided for skipping an initial portion of each line when making comparisons: Ignore the first fields fields, together with any blanks before each. fields is a positive decimal integer. A field is defined as a string of non-space, non-tab characters separated by tabs and/or spaces from its neighbors. Ignore the first chars characters. chars is a positive decimal integer. Each line in the input is assumed to be terminated with a new line character for purposes of comparison. Fields are skipped before characters. EXTERNAL INFLUENCES
Environment Variables must be equal to the value it had when the input files were sorted. determines the interpretation of text within files as single- and/or multi-byte characters, and defines a space character when the or option is used. determines the language in which messages are displayed. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multi-byte character code sets are supported. RETURN VALUE
Exit values are: 0 Successful completion. >0 Error condition occurred. AUTHOR
was developed by OSF and HP. SEE ALSO
comm(1), sort(1). STANDARDS CONFORMANCE
uniq(1)
All times are GMT -4. The time now is 07:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy