I have a file like below
10 10 21 32 43 54
20 10 25 36 47 58
30 19 20 31 42 53
40 10 24 35 46 57
50 10 28 39 40 51
I need to check if $1 <= 40, then print from $2 onwards.
If $1 > 40, the line is not printed.
So I would have an output like this
10 21 32 43 54
10 25 36 47... (10 Replies)
Hi. How do I find an expression with awk in only one column, and if it fits, then print that whole column.
1 apple oranges
2 bannanas pears
3 cats dogs
4 hesaid shesaid
echo "which number:"
read NUMBER (user inputs number 2 for this example)
awk " /$NUMBER/ {field to search is field... (2 Replies)
Hi ,
i am trying to prepare a text file by awk .
My code is like below
echo "$a $b $c $d $e $f $g $h "|nawk '{for(i=1;i<=5;i++){printf("%s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t\n", $1 , $2 ,$3 ,$4 ,$5 ,$6 ,$7 ,$8)}}' >> tempfile.txt
Now my req is $d will print as per user req . if user inputs... (2 Replies)
Hi Masters ,
Need your help regarding the below issue .
I am creating a new file with awk where diff rows in a particular column will different according to the user i/p.
If user i/p is 10,11 and 12 and requests for 6 rows then in a particular column will print with
10
10
11
11
12... (6 Replies)
I have a large 3479 line .csv file, the content of which looks likes this:
1;0;177;170;Guadeloupe;x
2;127;171;179;Antigua and Barbuda;x
3;170;144;2;Umpqua;x
4;170;126;162;Coos Bay;x
...
1205;46;2;244;Unmak Island;x
1206;47;2;248;Yunaska Island;x
1207;0;2;240;north sea;x... (5 Replies)
Dear All,
I have a data file input.csv like below. (Only five column shown here for example.)
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
3,2,4,5,6
5,3,5,5,6
From this I want the below output
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
where the second column... (4 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hi,
I have the following input in a file & need output as mentioned below(need counter of every occurance of field which is to be increased by 1).
Input:
919143110065
919143110065
919143110052
918648846132
919143110012
918648873782
919143110152
919143110152
919143110152... (2 Replies)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Discussion started by: TestPractice
5 Replies
LEARN ABOUT DEBIAN
colrm
COLRM(1) BSD General Commands Manual COLRM(1)NAME
colrm -- remove columns from a file
SYNOPSIS
colrm [start [stop]]
DESCRIPTION
The colrm utility removes selected columns from the lines of a file. A column is defined as a single character in a line. Input is read
from the standard input. Output is written to the standard output.
If only the start column is specified, columns numbered less than the start column will be written. If both start and stop columns are spec-
ified, columns numbered less than the start column or greater than the stop column will be written. Column numbering starts with one, not
zero.
Tab characters increment the column count to the next multiple of eight. Backspace characters decrement the column count by one.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of colrm as described in environ(7).
EXIT STATUS
The colrm utility exits 0 on success, and >0 if an error occurs.
SEE ALSO awk(1), column(1), cut(1), paste(1)HISTORY
The colrm command appeared in 3.0BSD.
BSD August 4, 2004 BSD