Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string.
Previously, I was outputting just each paragraph with that search string with:
cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
Hi,
So I'm kinda new to shell scripts and the like. I've picked up quite a bit of use from browsing the forums here but ran into a new one that I can't seem to find an answer for.
I'm looking to parse/find a string AND the next 15 or so charachters that follow the string within a text file... (1 Reply)
hi, i'm new to shell scripting.
I have a text file(sample.txt). It contains the different username & password for different users of oracle db.
.txt content
user1|password1
user2|password2
user3|password3
user4|password4
First read the text file and take the username and password then... (5 Replies)
Hi ,
I have a simple text file with contents as below:
12345678900 971,76 4234560890
22345678900 5971,72 5234560990
32345678900 71,12 6234560190
the new csv-file should be like:
Column1;Column2;Column3;Column4;Column5
123456;78900;971,76;423456;0890... (9 Replies)
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB and add/replace... (1 Reply)
Dear All
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB... (5 Replies)
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file.
Please use CODE tags as... (7 Replies)
please help to write a awk command-line programs to achieve the following functions: Thank in advance.
Requeset Description:
compare two files f1 and f2, export to file f3:
1 Delete duplicate rows of in file f1 and file f2
2 If the 1th column of file f1 and file f2 is the same, then export... (1 Reply)
Discussion started by: weichanghe2000
1 Replies
LEARN ABOUT SUNOS
head
head(1) User Commands head(1)NAME
head - display first few lines of files
SYNOPSIS
head [-number | -n number] [filename...]
DESCRIPTION
The head utility copies the first number of lines of each filename to the standard output. If no filename is given, head copies lines from
the standard input. The default value of number is 10 lines.
When more than one file is specified, the start of each file will look like:
==> filename <==
Thus, a common way to display a set of short files, identifying each one, is:
example% head -9999 filename1 filename2 ...
OPTIONS
The following options are supported:
-n number The first number lines of each input file will be copied to standard output. The number option-argument must be a positive
decimal integer.
-number The number argument is a positive decimal integer with the same effect as the -n number option.
If no options are specified, head will act as if -n 10had been specified.
OPERANDS
The following operand is supported:
file A path name of an input file. If no file operands are specified, the standard input will be used.
USAGE
See largefile(5) for the description of the behavior of head when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes).
EXAMPLES
Example 1: Writing the first ten lines of all files
To write the first ten lines of all files (except those with a leading period) in the directory:
example% head *
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of head: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO cat(1), more(1), pg(1), tail(1), attributes(5), environ(5), largefile(5), standards(5)SunOS 5.10 1 Feb 1995 head(1)