Sponsored Content
Top Forums UNIX for Advanced & Expert Users Awk to print values of second file Post 302608226 by peteroc on Friday 16th of March 2012 01:28:45 PM
Old 03-16-2012
Awk to print values of second file

Hello,

I have a data file with 300,000 records in it, and another file which contains only the line numbers of roughly 13,000 records in the data file which have data integrity issues. I'm trying to find a way to print the original data by line number identified in the second file. How can I do this?

Please advise.

Thanks!
Pete
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk to print distinct col values

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)
Discussion started by: anduzzi
22 Replies

2. Shell Programming and Scripting

Print a key with its all values using awk/others

input COL1 a1 b1 c1 d1 e1 f1 C1 10 10 10 100 100 1000 C2 20 20 200 200 200 2000 output C1 a1 10 1 C1 b1 10 1 C1 c1 10 1 C1 d1 100 2 C1 e1 100 2 C1 f1 1000 3 C2 ... (12 Replies)
Discussion started by: ruby_sgp
12 Replies

3. Shell Programming and Scripting

Print required values at end of the file by using AWK

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)
Discussion started by: dvrbabu
7 Replies

4. Shell Programming and Scripting

awk, sed or perl regexp to print values from file

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)
Discussion started by: cabrao
2 Replies

5. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- 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)
Discussion started by: Santoshbn
10 Replies

6. Shell Programming and Scripting

Print minimum and maximum values using awk

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)
Discussion started by: quincyjones
2 Replies

7. Shell Programming and Scripting

How to print in awk matching $1 values ,to $1,$4 example given.?

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)
Discussion started by: rveri
3 Replies

8. Shell Programming and Scripting

awk print values between consecutive lines

I have a file in below format: file01.txt TERM TERM TERM ABC 12315 68.53 12042013 165144 ABC 12315 62.12 12042013 165145 ABC 12315 122.36 12052013 165146 ABC 12315 582.18 12052013 165147 ABC 12316 2.36 12052013 165141 ABC 12316 ... (8 Replies)
Discussion started by: alex2005
8 Replies

9. Shell Programming and Scripting

awk print odd values

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)
Discussion started by: SkySmart
2 Replies

10. Shell Programming and Scripting

awk to print line is values between two fields in separate file

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
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)
All times are GMT -4. The time now is 05:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy