how do you print the lines before and after the line you are interested in? Example: Line to be printed: line 344
Output:
line 343
line 344
line 345
Thanks (1 Reply)
Hi All,
I have a file with only one column and i need to subtract the adjacent lines of the same column and print it in the same column.
For Example:
(Input)
Col1
5
10
12
6
9
12
5
.
.
.
.output should be like this: (12 Replies)
Hi all,
I have a text file consisting of 4 columns. What I am trying to do is see whether column 2 repeats multiple times, and collapse those repeats into one row. For example, here is a snippet of the file I am trying to analyze:
1 Gamble_Win 14.282 0.502
1 Sure_Thing 14.858 0.174
1... (4 Replies)
Hey guys, maybe you can help me with this...
I want to read input.dat line by line, while doing a simple calculation between the second column value of the current line and the second column value of the next line (like a difference).
input is something like this:
0 3.945757
1 ... (1 Reply)
Hi All,
I'm looking to use AWK to pattern match lines in XML file - Example patten for below sample would be /^<apple>/
The sample I wrote out is very basic compared to what I am actually working with but it will get me started
I would like to keep the matched line(s) unchanged but have them... (4 Replies)
Hi Folks,
I have two arrays
a:
aaa bbb ccc ddd
ddd aaa bbb ccc
ddd ccc aaa bbb
b:
aaa bbb ccc
aaa ccc bbb
bbb aaa ccc
ccc bbb aaa
I want to compare row by row a(c1:c4) to b(c1:c3). If elements of 'b' match... (5 Replies)
Hi,
I have a file with contents.
file1:
<2013 tttaaa
abc123
<2013 gggdddd
<2013 sssssss
<2013 eeeee
I need to remove the lines which do not have the word "tttaaa"
can some one help ? (7 Replies)
Hi,
I have a quick question on parsing the hour/minute and value from a text file and remove the seconds portion. For example in the below text file:
20:26:01 95.83
20:27:01 96.06
20:28:01 95.99
20:29:01 7.11
20:30:01 5.16
20:31:01 8.27
20:32:02 9.79
20:33:01 11.27
20:34:01 7.83... (2 Replies)
Given this file (I separated them in block to make my explanation clearer):
92157768877;Sof_deme_Fort_Email_am_%yyyy%%mm%%dd%;EMAIL;20/02/2015;1;0;0
92157768877;Sof_trav_Fort_Email_am_%yyyy%%mm%%dd%;EMAIL;20/02/2015;1;0;0
91231838895;Sof_deme_faible_Email_am;EMAIL;26/01/2015;1 0;0... (1 Reply)
What is the correct syntax to have the awk parse the next line as well? The next in bold is where I think it should go, but I wanted to ask the experts since I am a beginner. The file to be parsed is attached as well. Thank you :).
awk 'NR==2 {split($2,a,"");b=substr(a,1,length(a-1));print... (6 Replies)
Discussion started by: cmccabe
6 Replies
LEARN ABOUT MOJAVE
iscntrl
ISCNTRL(3) BSD Library Functions Manual ISCNTRL(3)NAME
iscntrl -- control character test
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <ctype.h>
int
iscntrl(int c);
DESCRIPTION
The iscntrl() function tests for any control character. The value of the argument must be representable as an unsigned char or the value of
EOF.
In the ASCII character set, this includes the following characters (preceded by their numeric values, in octal):
000 NUL 001 SOH 002 STX 003 ETX 004 EOT
005 ENQ 006 ACK 007 BEL 010 BS 011 HT
012 NL 013 VT 014 NP 015 CR 016 SO
017 SI 020 DLE 021 DC1 022 DC2 023 DC3
024 DC4 025 NAK 026 SYN 027 ETB 030 CAN
031 EM 032 SUB 033 ESC 034 FS 035 GS
036 RS 037 US 177 DEL
RETURN VALUES
The iscntrl() function returns zero if the character tests false and returns non-zero if the character tests true.
COMPATIBILITY
The 4.4BSD extension of accepting arguments outside of the range of the unsigned char type in locales with large character sets is considered
obsolete and may not be supported in future releases. The iswcntrl() function should be used instead.
SEE ALSO ctype(3), isalnum_l(3), iswcntrl(3), ascii(7)STANDARDS
The iscntrl() function conforms to ISO/IEC 9899:1990 (``ISO C90'').
BSD July 17, 2005 BSD