Sponsored Content
Top Forums Shell Programming and Scripting Sorting/Arranging file based on tags using awk Post 302988890 by MadeInGermany on Wednesday 4th of January 2017 01:02:50 PM
Old 01-04-2017
Looks like the pipe character is the field separator.
Are the tags always in field 8 and higher?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

re-arranging text in a file with AWK

Hi Gurus, I have a text file that I want to process with the following structure; 4528788 Blah - Something 9341423 Text - Somethinghere 98792223,5546761 Some - More - Text 5119503,5159504,1234567 Text - More - Text 13459695 Stuff - Text Again 13526583 Junk - More Text Here 13595177... (1 Reply)
Discussion started by: th3g0bl1n
1 Replies

2. Shell Programming and Scripting

sorting file based on two or more columns

Hi gang. I'm using a unix/mac system and i'm trying to sort a file (more than 1,000,000 lines). chr1 100000965 100001001 - chr1 100002155 100002191 + chr1 100002165 100002201 + chr1 100002525 100002561 - chr1 10000364 ... (2 Replies)
Discussion started by: labrazil
2 Replies

3. Shell Programming and Scripting

sorting csv file based on column selected

Hi all, in my csv file it'll look like this, and of course it may have more columns US to UK;abc-hq-jcl;multimedia UK to CN;def-ny-jkl;standard DE to DM;abc-ab-klm;critical FD to YM;la-yr-tym;standard HY to MC;la-yr-ytm;multimedia GT to KJ;def-ny-jrt;critical I would like to group... (4 Replies)
Discussion started by: tententen
4 Replies

4. Shell Programming and Scripting

Sorting file based on names

Hi I have some files in directory and the names of files are like jnhld_15233_2010-11-23 jnhld_15233_2007-10-01 jnhld_15233_2001-05-04 jnhld_15233_2011-11-11 jnhld_15233_2005-06-07 jnhld_15233_2000-04-01 ..etc How can i sort these files based on the date in the file name so that ... (4 Replies)
Discussion started by: morbid_angel
4 Replies

5. Shell Programming and Scripting

sorting based on a specified column in a text file

I have a tab delimited file with 5 columns 79 A B 20.2340 6.1488 8.5086 1.3838 87 A B 0.1310 0.0382 0.0054 0.1413 88 A B 46.1651 99.0000 21.8107 0.2203 89 A B 0.1400 0.1132 0.0151 0.1334 114 A B 0.1088 0.0522 0.0057 0.1083 115 A B... (2 Replies)
Discussion started by: Lucky Ali
2 Replies

6. UNIX for Dummies Questions & Answers

Sorting a file based on the absolute value of a column

I would like to sort a tab delimited text file based on the absolute value of its second column. How do I go about doing that? Thanks! Example input: A -12 B 0 C -6 D 7 Output: A -12 D 7 C -6 B 0 (4 Replies)
Discussion started by: evelibertine
4 Replies

7. Shell Programming and Scripting

Sorting file based on name

Hi team, We have few files landing to our server based on sequence number. These files have to be processed in the sequence number order. Once the sequence number has reached its maximum, the files with sequence number 0000 has to be processed. For example: IN9997 IN9998 IN9999 IN0000... (7 Replies)
Discussion started by: anijan
7 Replies

8. Shell Programming and Scripting

Sorting file based on a numeric column

Hi, I use UBUNTU 12.04. I have a file with this structure: Name 2 1245787 A G 12 14 12 14 .... Name 1 1245789 C T 13 12 12 12..... I would like to sort my file based on the second column so to have this output for example: Name 1 1245789 C T 13 12 12 12..... Name 2 1245787 A G 12 14... (4 Replies)
Discussion started by: Homa
4 Replies

9. Shell Programming and Scripting

List the files after sorting based on file content

Hi, I have two pipe separated files as below: head -3 file1.txt "HD"|"Nov 11 2016 4:08AM"|"0000000018" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" head -3 file2.txt "HD"|"Nov 15 2016 2:18AM"|"0000000019" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" I want to list the... (6 Replies)
Discussion started by: Prasannag87
6 Replies

10. Shell Programming and Scripting

Sorting based on File name

Hi All I have a requirement to list all the files in chronological order based on the date value in the file name.For ex if I have three files as given below ABC_TEST_20160103_1012.txt ABC_TEST_20160229_1112.txt ABC_TEST_20160229_1112.txt I have written code as given below to list out... (2 Replies)
Discussion started by: ginrkf
2 Replies
yuv4mpeg(5)							MJPEG Tools Manual						       yuv4mpeg(5)

NAME
YUV4MPEG2 - video stream format used by pipe-based MJPEGtools DESCRIPTION
Many of the MJPEGtools communicate via pipes and act as filters (or sources or sinks). The format of video data used in the pipes is referred to as "YUV4MPEG", or, more precisely, "YUV4MPEG2". (The format was extended and codified during v1.5.x of the tools.) The basic structure is a stream header followed by an unlimited number of frames. Each frame itself consists of a header followed by video data. The headers are vaguely human-readable ASCII, but the video data is simple byte-size binary. The MJPEGtools distribution has a C library (libmjpegutils) which contains functions for manipulating YUV4MPEG2 streams. We recommend that you use this library rather than writing your own code if possible. See the header file "yuv4mpeg.h" for a description of these functions. Design Goals: o Easy to parse both via C or sh. o Extensible; easy to add new parameters while maintaining backwards compatibility. o Simple upgrade from original "YUV4MPEG" format. Drawbacks: o Frame headers do not have constant size, so streams are not seekable. GRAMMAR
The precise description of the the YUV4MPEG2 stream format is as follows: STREAM consists of - one STREAM-HEADER - unlimited number of FRAMEs STREAM-HEADER consists of - magic string "YUV4MPEG2" - unlimited number of TAGGED-FIELDs, each preceeded by a ' ' (single space) separator - single ' ' line terminator FRAME consists of - one FRAME-HEADER - "length" octets of planar YCbCr 4:2:0 image data (If the stream is interlaced, then the two fields per frame are interleaved, with proper spatial ordering.) FRAME-HEADER consists of - magic string "FRAME" - unlimited number of TAGGED-FIELDs, each preceeded by a ' ' (single space) separator - single ' ' line terminator TAGGED-FIELD consists of - single ASCII character tag - VALUE (which does not contain whitespace) VALUE consists of - RATIO, or - integer (base 10 ASCII representation), or - single ascii character, or - string (multiple ASCII characters) RATIO consists of - numerator (base 10 ASCII integer) - ':' (a colon) - denominator (base 10 ASCII integer) Header tags fall into three categories: optional, required and has-default. Optional tags are completely optional and may be omitted from a header. Required tags must be present in a header. Has-Default tags have a default value which is implied if the tag is not present. Independent of these categories, some tags allow an "unknown" value and some do not. The supported tags for the STREAM-HEADER: W[integer] - frame width in pixels, must be > 0 (required) H[integer] - frame height in pixels, must be > 0 (required) C[string] - chroma subsampling, image data format (has default) 420jpeg - 4:2:0 with JPEG/MPEG-1 siting (default) 420mpeg2 - 4:2:0 with MPEG-2 siting 420paldv - 4:2:0 with PAL-DV siting 411 - 4:1:1, cosited 422 - 4:2:2, cosited 444 - 4:4:4 (no subsampling) 444alpha - 4:4:4 with an alpha channel mono - luma (Y') plane only I[char] - interlacing specification: (has default) ? - unknown (default) p - progressive/none t - top-field-first b - bottom-field-first m - mixed-mode: refer to 'I' tag in frame header F[ratio] - frame-rate (has default of 0:0 == unknown) A[ratio] - sample aspect ratio (has default of 0:0 == unknown) X[string] - 'metadata' (optional; unparsed, but passed around) The currently supported tags for the FRAME-HEADER: I[string] - framing and sampling (required if-and-only-if Im is present in stream header). Value is a string of three characters "xyz" which have the following meanings: x: frame presentation t - top-field-first T - top-field-first and repeat b - bottom-field-first B - bottom-field-first and repeat 1 - single progressive frame 2 - double progressive frame (repeat) 3 - triple progressive frame (repeat) y: frame temporal sampling p - progressive (fields sampled at same time) i - interlaced (fields sampled at different times) z: frame chroma-subsampling p - progressive (subsampling over whole frame) i - interlaced (each field subsampled independently) ? - unknown (allowed only for non-4:2:0 subsampling) X[string] - 'metadata' (optional; unparsed, but passed around) Note that a filter application must faithfully forward all "X" tags from input pipe to output pipe (unless it uses one of those tags, of course). The supplied library will do this automatically if the functions y4m_copy_stream_info() and y4m_copy_frame_info() are used appro- priately. NOTES ON IMAGE DATA
All image data is in the CCIR-601 Y'CbCr colorspace, presented plane-by-plane in row-major order. Each sample within each plane is one octet (8-bits) in size. When all planes are present, they are transmitted in the order Y', Cb, Cr, potentially followed by an alpha/trans- parency mask plane (for the 444alpha chroma format). The alpha channel data is follows the same range as the Y' luma channel: full trans- parency is at 16 and full opacity is at 235. All Y' and alpha planes consist of (height X width) octets. The size of the chroma planes depends on the subsampling mode: - 4:4:4 - (height X width) octets - 4:2:2 - (height X width) / 2 octets - 4:1:1 - (height X width) / 4 octets - 4:2:0 - (height X width) / 4 octets NOTES ON FRAMING
(More to come here.) SEE ALSO
mjpegtools(1), yuv4mpeg.h AUTHOR
This manual page Copyright 2004 Matthew J. Marjanovic. MJPEG Linux Square 25 November 2002 yuv4mpeg(5)
All times are GMT -4. The time now is 04:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy