awk 'FNR==NR { LINE[$1]++; next }; LINE[FNR]' linesfile datafile
Code:
awk '# FNR is the line number for a particular file, NR is the total lines processed.
# They will only be equal when the very first file is being processed.
# So for the first file, load each line into an array for later reference,
# then start over on the next line without executing any statements below it.
FNR==NR { LINE[$1]++; next };
# Print all lines where the line number in the file matches a line number from linesfile.
LINE[FNR]' linesfile datafile
Hi Guys...
I am newbie to awk and would like a solution to probably one of the simple practical questions.
I have a test file that goes as:
1,2,3,4,5,6
7,2,3,8,7,6
9,3,5,6,7,3
8,3,1,1,1,1
4,4,2,2,2,2
I would like to know how AWK can get me the distinct values say for eg: on col2... (22 Replies)
I am looking help in awk, quick overview. we will get feed from external system . The input file looks like below.
Detail Id Info Id Order Id STATUS Status Date FileDetail
99127942 819718 CMOG223481502 PR 04-17-2011 06:01:34PM... (7 Replies)
Hello all
According to the following file (orignal one contains 200x times the same structure...) I was wondering if someone could help me to print <byte>??</byte> values
example, running this script/command like
./script.sh xxapp
I would expect as output: 102 116 112
./script.sh xxapp2... (2 Replies)
- I have two files (File 1 and File 2) and the contents of the files are mentioned below.
- I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2.
- I tried to modify and use... (10 Replies)
Can I print the minimum and maximum values of values in first 4 columns ?
input
3038669 3038743 3037800 3038400 m101c
3218627 3218709 3217600 3219800 m290
.............
output
3037800 3038743 m101c
3217600 3219800 m290 (2 Replies)
Hi Experts,
I am trying to get the output from a matching pattern but unable to construct the awk command:
file :
aa bb cc 11
dd aa cc 33
cc 22 45 68
aa 33 44 44
dd aa cc 37
aa 33 44 67
I want the output to be : ( if $1 match to "aa" start of the line,then print $4 of that line, and... (3 Replies)
value=$(some command)
for all in `echo $value`
do
awk checks each value (all) to see if it is a odd number. if so, prints the value
done
sounds easy enough but i've been unable to find anything on google. (2 Replies)
I am trying to use awk to find all the $3 values in file2 that are between $2 and $3 in file1. If a value in $3 of file2 is between the file1 fields then it is printed along with the $6 value in file1. Both file1 and file2 are tab-delimited as well as the desired output. If there is nothing to... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT DEBIAN
ogmsplit
OGMSPLIT(1) User Commands OGMSPLIT(1)NAME
ogmsplit - Split OGG/OGM files into several smaller OGG/OGM files
SYNOPSIS
ogmsplit [options] inname
DESCRIPTION
ogmsplit can be used to easily split an OGM file after a given size. Several OGM files will be created that each start with a keyframe.
inname Use 'inname' as the source.
-o, --output out
Use 'out' as the base name. Ascending part numbers will be appended to it. Default is 'inname'. Examples:
1) If -o output.ogg is given on the command line then ogmsplit will create output-000001.ogg, output-000002.ogg and so on.
2) If no -o option is given and the input's name is movie.ogm then ogmsplit will create movie-000001.ogm and so on.
The operation mode can be set with exactly one of -s, -t, -c or -p. The default mode is to split by size (-s).
-s, --size size
Size in MiB ( = 1024 * 1024 bytes) after which a new file will be opened (approximately). Default is 700MiB. Size can end in 'B' to
indicate 'bytes' instead of 'MiB'.
-t, --time time
Split after the given elapsed time (approximately). 'time' takes the form HH:MM:SS.sss or simply SS(.sss), e.g. 00:05:00.000 or
300.000 or simply 300.
-c, --cuts cuts
Produce output files as specified by cuts, a list of slices of the form "start-end" or "start+length", separated by commas. If start
is omitted, it defaults to the end of the previous cut. start and end take the same format as the arguments to -t.
-n, --num num
Don't create more than num separate files. The last one may be bigger than the desired size. Default is an unlimited number of
files. Can only be used with -s or -t.
--frontend
Frontend mode. Progress output will be terminated by
instead of
.
-p, --print-splitpoints
Only print the key frames and the number of bytes encountered before each. Useful to find the exact splitting point.
-v, --verbose
Be verbose and show each OGG packet. Can be used twice to increase verbosity.
-h, --help
Show this help.
-V, --version
Show version information.
CHAPTER INFORMATION
ogmsplit correctly handles chapter information. During the first pass the chapter information, if any is present, will be adjusted to match
the output files generated. Chapters that are not contained in the current output file are removed entirely. The other chapters are renum-
bered to start at 1, and their timestamps will be recalculated.
Example: If your source file contains these four chapters:
CHAPTER01=00:00:00.000
CHAPTER01NAME=Chapter 01
CHAPTER02=00:10:00.000
CHAPTER02NAME=Chapter 02
CHAPTER03=00:20:00.000
CHAPTER03NAME=Chapter 03
CHAPTER04=00:25:00.000
CHAPTER04NAME=Chapter 04
and you split after 15 minutes, then the first output file will only contain the first two chapters as shown above, and the second output
file will contain the following two chapters and the remaining part of the first:
CHAPTER01=00:00:00.000
CHAPTER01NAME=Chapter 02 (continued)
CHAPTER02=00:05:00.000
CHAPTER02NAME=Chapter 03
CHAPTER03=00:10:00.000
CHAPTER03NAME=Chapter 04
Note that only variable names are changed, not the chapter names themselves. The exception is the first chapter of the second and follow-
ing files where "(continued)" is appended in order to indicate that this is not the start of this chapter. If you want to change them as
well you'll have to remerge the resulting file with a new chapter file.
AUTHOR
ogmsplit was written by Moritz Bunkus <moritz@bunkus.org>.
SEE ALSO ogmmerge(1), ogminfo(1), ogmdemux(1), ogmcat(1), dvdxchap(1)WWW
The newest version can always be found at <http://www.bunkus.org/videotools/ogmtools/> <http://www.bunkus.org/videotools/ogmtools/>
ogmsplit v1.5 November 2004 OGMSPLIT(1)