Hi Chaps,
I'm trying to print the line number of a comma delimited file where the second field in the line is blank using AWK. Here is the code I have so far where am I going wrong. It is the last column in the file.
nawk -v x==0 'BEGIN {FS=",";OFS=","} x++ if ($2 == " ") print $x' bob.tst
... (3 Replies)
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
hi,
i have a file, i need to search for a string , if the line contains i need to print that line number and line ,
please help
thanks in advance
Satya (5 Replies)
Hi Everybody,
I am trying to write a script that will get some perticuler data from a file and redirect to a file.
My Question is,
I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line.
I know the line numbers, I need to get all... (9 Replies)
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Hi,
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
Thanks, (6 Replies)
Hello,
I have a question on how to find the line number of the first column that contains specific data. I know how to print all the line numbers of those columns, but haven't been able to figure out how to print only the first one that is found.
For example, if my data has four columns:
115... (3 Replies)
Hi,
How to print the number of fields in each record with the line number?
Lets saw I have
3212|shipped|received|
3213|shipped|undelivered|
3214|shipped|received|delivered
I tried the code
awk -F '|' '{print NF}'
This gives me ouput as
3
3
4 (5 Replies)
Hello everyone,
I don't really know anything about scripting, but I have to manage to make this script, out of necessity.
#!/bin/bash
while read -r line; do #I'm reading from a big wordlist
instructions using $line
done
Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
4 Replies
LEARN ABOUT HPUX
tput
tput(1) General Commands Manual tput(1)NAME
tput - query terminfo database
SYNOPSIS
type] capname...
type] capname [parms...]
DESCRIPTION
The command uses the database to make terminal-dependent capabilities and information available to the shell (see terminfo(4)). The com-
mand outputs a string if the attribute (capname) is of type string, or an integer if the attribute is of type integer. If the attribute is
of type boolean, simply sets the exit code for TRUE, for FALSE), and produces no output.
Command-line Arguments
The command recognizes the following command-line arguments:
Indicates the type of terminal.
Normally this flag is unnecessary because the default is taken from the environment variable
capname Indicates the attribute from the database. See terminfo(4). In addition, the following capnames are supported:
Echo the clear-screen sequence for the current terminal.
Echo the initialize sequence for the current terminal.
Echo the sequence that will reset the current terminal.
parms If the capname takes optional numeric parameters, the parms will be placed in the string output by
The capnames are read from stdin and multiple capnames are allowed. Only one capname is allowed per line when reading
from stdin.
EXTERNAL INFLUENCES
Environment Variables
determines the locale to use. This overrides settings of other environment variables.
determines the language to use for messages.
determines the terminal type if the option is not specified.
EXAMPLES
Echo clear-screen sequence for the current terminal.
Print the number of columns for the current terminal.
Print the number of columns for the 70092 terminal.
Set shell variable to stand-out-mode sequence for current terminal.
This might be followed by a prompt:
Set exit code to indicate if current terminal is a hard copy terminal.
Clear the screen, move the cursor to line 10, column 20 and turn on bold.
RETURN VALUE
If capname is of type boolean, then the exit code is set to for true and for false.
If capname is not of type boolean and fails, an error message is printed, and exit code is set to one of the following depending on the
failure:
The capability name is of type integer and does not exist.
Usage error.
Unknown terminal type.
Unknown capability name.
An error occurred.
If the exit code is a is printed if a capability name of type integer is requested for a terminal that has no entry for that capability
name in the database (such as
FILES
Terminfo data base
Definition files
SEE ALSO
stty(1), untic(1M), terminfo(4).
STANDARDS CONFORMANCE tput(1)