10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi gurus,
I would like to be able to use awk to process 1 file as such:
abc 1 2 3 4 5 6 7 8 9 10
flags 1 2 4
flags 1 2 5
abc 2 3 4 5 6 7 8 9 10 11
flags 1 2 3
abc 4 5 6 7 8 9 6 7 78 89
flags 1 2 3
flags 1 2 4
flags 1 2 3 4
I would like to be able to print field 1 and 5 when the... (4 Replies)
Discussion started by: revaroo
4 Replies
2. Shell Programming and Scripting
Hi ,
I am looking to print the whole string from file2.txt but it is only printing 77 but not the whole matched string from File2.txt Any help is appreciated.
Thanks,
Script
awk '
BEGIN {
OFS="\t"
out = "a.txt"}
NR==FNR && NF {a=$0; next}
function print_65_11() {
if... (11 Replies)
Discussion started by: High-T
11 Replies
3. Shell Programming and Scripting
RHEL 5.8
I have a text file like below. I want to grep for a string and then print the next 4 lines including the line with the string I grepped for
For eg:
I want grep for the string HANS and then print the next 4 lines including HANS
$ cat someText.txt
JOHN
NATIONALITY:... (7 Replies)
Discussion started by: omega3
7 Replies
4. Linux
Hi all,
I have a text data file. My aim here is to find line called *FIELD* AV for every record and print lines after that till *FIELD* RF. But here I want first 3 to four lines for very record as well. FIELD AV is some where in between for very record. SO I am not sure how to retrieve lines in... (2 Replies)
Discussion started by: kaav06
2 Replies
5. Shell Programming and Scripting
Hi,
I have a file whose lines are something like
Tchampionspsq^@~^@^^^A^@^@^@^A^A^Aÿð^@^@^@^@^@^@^@^@^@^@^A^@^@^@^@^?ð^@^@^@^@^@^@^@?ð^@^@^@^@^@^@pppsq^@~^@#@^@^@^@^@^@^Hw^H^@^@^@^K^@^@^@^@xp^At^@^FTtime2psq^@ ~^@^^^A^@^@^@^B^A
I need to extract all words matching T*psq from the file.
Thing is... (4 Replies)
Discussion started by: shekhar2010us
4 Replies
6. Shell Programming and Scripting
14:15:00-
abcdefghijkl.
14:30:00-
abcdefghijkl.
14:35:00-
abcdefghijkl.
123456789.
123456789.
14:45:00-
abcdefghijkl.
14:50:00-
abcdefghijkl.
123456789.
15:30:00-abcdefghijkl. (3 Replies)
Discussion started by: dev_shivv
3 Replies
7. Solaris
For example a log file looks like below-
13:30:00-
abcdefghijklhjghjghjhskj.
abcdefghijkl.
14:15:00-
abcdefghijkl.
14:30:00-
abcdefghijkl.
14:35:00-
abcdefghijkl.
123456789.
123456789.
14:45:00-
abcdefghijkl. (0 Replies)
Discussion started by: dev_shivv
0 Replies
8. Shell Programming and Scripting
I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like:
<ROW>
some information
more information
</ROW>
I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies
9. Shell Programming and Scripting
Hi
I have a myfile.txt contains the following:
CONTEXT {
AAAAA
}
...
CONTEXT {
BBBBB
}
I want to extract the lines in between CONTEXT { ... }, one by one.
Hence I wrote a command like the following,
sed -n '/^CONTENT/,/^}/ {
w a.txt
}' myfile.txt
The problem with this... (5 Replies)
Discussion started by: hezjing
5 Replies
10. Shell Programming and Scripting
I have a huge file and want to separate it into several subsets.
The file looks like:
C1 C2 C3 C4 ... (variable names)
1 ....
2 ....
3 ....
:
22 ....
23 ....
I want to separate the huge file using the column 1, which has numbers from 1 to 23 (but there are different amount of... (8 Replies)
Discussion started by: AMBER
8 Replies