After using the "Split" function and then while saving the columns into an array,
I am struggling how to eliminate the first 231 lines and the last 4 lines, because these are the header information and footer information.
how do I use the array splice while saving the column values into the array ?
Could someone please help me out to eliminate the Header and footer information while saving the data into the array ?
I have a 30 column tab delimited record file. I need to extract the first 10column. The following command to cut was not working
cut -f 1-10 -d "\t" filename.
Could any one keep on this .
Thanks in Advance (4 Replies)
Hi everybody,
This time I am having one issue in perl.
I have to create comma separated file using the following type of information. The problem is the columns do not have any specific delimiter. So while using split I am getting different value. Some where it is space(S) and some where it is... (9 Replies)
Hi,
I need to append the data in to a file by using tab delimiter.
eg:
echo "Data1" >> filename.txt
echo "\t" >> filename.txt (its not working)
echo "Data2" >> filename.txt.
the result sould be like this.
Data1 Data2 (6 Replies)
hi every one
plz help me
i want to search for a line contains tabspace
This is a line The should be changed
see the above line is seperated with tab space i want to replace that tab space in to # as
This is a line#The should be changed
i have tried with... (4 Replies)
Hello,
Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another.
Thanks,
G (4 Replies)
Hello experts,
I am new to this group and to 'SED' and 'AWK'. I have data (text file) with 5 columns (C_1-5) and 100s of lines (only 10 lines are shown below as an example). I have to find or select only the id numbers (C-1) of specific lines with '90' in the same line (of C_3) AND with '20' in... (6 Replies)
Hi,
I have two files like:
file1
chr1 40
chr1 50
chr2 10
chr2 60
file2
chr1 30
chr1 50
chr2 15
chr2 20
and want to get the difference of column 2 when column 1 is the same in both files. (4 Replies)
Hello,
I have some problem in inserting the space for the pairs of columns.
I have the input file :
I used this code below in replacing it using space in specific column (replace space in each two columns)
sed -e "s/,/ /2" -e "s/,/ /3" inputfile
Output showed :
However, I have many... (3 Replies)
Hi all ,
I have a file having 12 columns tab delimited .
I need to read this file and remove the column 3 and column 4 and insert a word in column 3 as "AVIALABLE "
Is there a way to do this . I am trying like below
Thanks
DJ
cat $FILENAME|awk -F"\t" '{ print $1 "\t... (3 Replies)
Discussion started by: Hypesslearner
3 Replies
LEARN ABOUT OSX
nl
NL(1) BSD General Commands Manual NL(1)NAME
nl -- line numbering filter
SYNOPSIS
nl [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num] [-n format] [-s sep] [-v startnum] [-w width] [file]
DESCRIPTION
The nl utility reads lines from the named file or the standard input if the file argument is ommitted, applies a configurable line numbering
filter operation and writes the result to the standard output.
The nl utility treats the text it reads in terms of logical pages. Unless specified otherwise, line numbering is reset at the start of each
logical page. A logical page consists of a header, a body and a footer section; empty sections are valid. Different line numbering options
are independently available for header, body and footer sections.
The starts of logical page sections are signalled by input lines containing nothing but one of the following sequences of delimiter charac-
ters:
Line Start of
::: header
:: body
: footer
If the input does not contain any logical page section signalling directives, the text being read is assumed to consist of a single logical
page body.
The following options are available:
-b type Specify the logical page body lines to be numbered. Recognized type arguments are:
a Number all lines.
t Number only non-empty lines.
n No line numbering.
pexpr Number only those lines that contain the basic regular expression specified by expr.
The default type for logical page body lines is t.
-d delim Specify the delimiter characters used to indicate the start of a logical page section in the input file. At most two characters
may be specified; if only one character is specified, the first character is replaced and the second character remains
unchanged. The default delim characters are ``:''.
-f type Specify the same as -b type except for logical page footer lines. The default type for logical page footer lines is n.
-h type Specify the same as -b type except for logical page header lines. The default type for logical page header lines is n.
-i incr Specify the increment value used to number logical page lines. The default incr value is 1.
-l num If numbering of all lines is specified for the current logical section using the corresponding -b a, -f a or -h a option, spec-
ify the number of adjacent blank lines to be considered as one. For example, -l 2 results in only the second adjacent blank
line being numbered. The default num value is 1.
-n format Specify the line numbering output format. Recognized format arguments are:
ln Left justified.
rn Right justified, leading zeros suppressed.
rz Right justified, leading zeros kept.
The default format is rn.
-p Specify that line numbering should not be restarted at logical page delimiters.
-s sep Specify the characters used in separating the line number and the corresponding text line. The default sep setting is a single
tab character.
-v startnum Specify the initial value used to number logical page lines; see also the description of the -p option. The default startnum
value is 1.
-w width Specify the number of characters to be occupied by the line number; in case the width is insufficient to hold the line number,
it will be truncated to its width least significant digits. The default width is 6.
ENVIRONMENT
The LANG, LC_ALL, LC_CTYPE and LC_COLLATE environment variables affect the execution of nl as described in environ(7).
EXIT STATUS
The nl utility exits 0 on success, and >0 if an error occurs.
SEE ALSO jot(1), pr(1)STANDARDS
The nl utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
The nl utility first appeared in AT&T System V Release 2 UNIX.
BUGS
Input lines are limited to LINE_MAX (2048) bytes in length.
BSD January 26, 2005 BSD