Printing the lines that appear in an other file, and the three lines after them
Hi !
I need some help with a script I am writing.
I am trying to compare two files, the first file being in this format :
For each header, I want to check if it appears in the second file, and if it is the case print the header and the three corresponding lines of text.
I found several methods for finding the header in the second file, but I don't know how to get the lines that follow.
as the title, I had try use "wc -l test.txt" but it give me "<many spaces> 384 test.txt" but the result I want is just "384" could any person can help me that?
Thx:( (5 Replies)
i have to print first n lines of a file. how can i do that without using head command. for some reason i do not want to use Head. is there a way to get that result using awk or sed?.
i an using this on korn shell for AIX
Thanks.. (7 Replies)
Dear users,
I need to count the number of lines in a simple text file and print the number on the first line of that same file.
I know I can count the lines using
wc -l file.txt
this gives for example
100 file.txt
I need the number 100 to be printed at the very top of file.txt... (2 Replies)
Hi,
A very Good Evening to All,
I am writing a script for my application. I have a file with 1000 lines. Among that 1000 lines i am searching for a particular string. And from that string i need to pull all the data in to a seperate file.
For example the contents of my file is as below.
... (4 Replies)
I am trying to print a simple ascii file but it comes out as a staggered output. I know there's a simple solution but can't remember it, am a little rusty.
eg. a file that look like
aa
bbb
cccc
would print out like
aa
bbb
ccccc
Any pointers would be... (5 Replies)
Hello,
I want to print a number of lines of a file after a specific expression of a line.
I have this sed command but it prints only 1 line after the expression.
How could I adapt it to print for instance 10 lines after or 15 lines after ?
sed -n '/regexp/{n;p;}'
Thx & Regs,
Rany. (5 Replies)
Hello all,
I need to print all the lines before a specific string and print a custom message 2 lines after that.
So far I have managed to print everything up the string, inclusively, but I can't figure out how to print the 2 lines after that and the custom message.
My code thus far is:... (4 Replies)
Hi,
I'm trying to auto generate some php files with a default preamble at the top which is a block comment.
The problem is that my output has no new lines and it looks like the output from "ls" is being printed after everyline
This is my code
#!/bin/bash
read -d '' pre_amble... (1 Reply)
Hi guys,
I was wondering if there was an easy solution, using tcsh, to print out lines that appear twice with a given pattern in a file?
So if I am looking for lines with "test" in a given file that contains:
blah
test blah1
blah //don't print this out as it doesn't have... (3 Replies)
Hi
I have a file like
# vi require.txt
1,BANK,Read blocks that cycle.
yellow
Read blocks.
2,ACCOUNT,Finished
Red
Finished .
3,LOAN, pipe
white
pipe
4,PROFIT,Resolve.
black
Resolve
Am using like
cat require.txt | grep -w ACCOUNTThe output I get is (8 Replies)
Discussion started by: Priya Amaresh
8 Replies
LEARN ABOUT V7
getinfo
GETINFO(1) General Commands Manual GETINFO(1)NAME
getinfo - get header information from a RADIANCE file
SYNOPSIS
getinfo [ -d ][ file .. ]
getinfo -
DESCRIPTION
Getinfo reads the header of each RADIANCE file and writes it to the standard output. Octree and picture files are in a binary format,
which makes it difficult to determine their content. Therefore, a few lines of text are placed at the beginning of each file by the RADI-
ANCE program that creates it. The end of the header information and the start of the data is indicated by an empty line. The -d option
can be used to print the dimensions of an octree or picture file instead. For an octree, getinfo -d prints the bounding cube (xmin ymin
zmin size). For a picture, getinfo -d prints the y and x resolution (-Y yres +X xres). If no file is given, the standard input is read.
The second form of getinfo with a hyphen simply removes the header and copies the body of the file from the standard input to the standard
output.
EXAMPLE
To print the header information from scene1.oct and scene2.hdr:
getinfo scene1.oct scene2.hdr
AUTHOR
Greg Ward
SEE ALSO oconv(1), pfilt(1), rhinfo(1), rpict(1), rvu(1)RADIANCE 1/15/99 GETINFO(1)