Sponsored Content
Top Forums Shell Programming and Scripting Reading specific contents from a file and appending it to another file Post 85251 by dnicky on Tuesday 4th of October 2005 05:45:47 AM
Old 10-04-2005
Many thanks for your help.

This works perfect.


Regards

dnicky
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

reading ,writing,appending ,manipulating a file.

Hi my prob statement is to create a new file or to append to the 1tst file the followign chages. File 1: txt file. portfolio No a b c d abc 1 Any Any Any charString cds 2 values values values charString efd 3 can can can charString fdg 4 come come come charString... (4 Replies)
Discussion started by: szchmaltz
4 Replies

2. Shell Programming and Scripting

Reading specific contents from 1 input files and appending it to another input file

Hi guys, I am new to AWK and unix scripting. Please see below my problem and let me know if anyone you can help. I have 2 input files (example given below) Input file 2 is a standard file (it will not change) and we have to get the name (second column after comma) from it and append it... (5 Replies)
Discussion started by: sksahu
5 Replies

3. Shell Programming and Scripting

Reading and printing one by one contents of a file

I have a file which has following contents: localhost_IP_SIP_1233026552455.xml localhost_IP_SIP_1233026552460.xml localhost_IP_SIP_1233026552467.xml localhost_IP_SIP_1233026552759.xml localhost_IP_SIP_1233026552969.xml localhost_IP_SIP_1233026552975.xml ... (2 Replies)
Discussion started by: Aditya.Gurgaon
2 Replies

4. Shell Programming and Scripting

Bash copy file contents into an existing file at a specific location

Hi all I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 ... (6 Replies)
Discussion started by: gshepherd7
6 Replies

5. UNIX for Dummies Questions & Answers

issue on reading the file and appending date

Hi Am having issue on appending time stamp I know the exact file names in the directory like a.dat b.dat c.dat e.dat f.dat I want to read all these file names and append the timestamp to each files like a.dat.20090604,b.dat.20090604 and move to the different directory. ... (3 Replies)
Discussion started by: bobprabhu
3 Replies

6. Shell Programming and Scripting

Reading file contents until a keyword

Hi Guys, I need to read a file until I find a blank line. and in the next iteration I want to continue reading from the line I find a keyword. For ex: my file looks like PDS_JOB_ALIAS CRITERIA_ITEM_TYPE PDS_JOB_CRITERIA_ITEM CRITERIA_ITEM_TYPE First I want to read the file... (2 Replies)
Discussion started by: infintenumbers
2 Replies

7. UNIX for Advanced & Expert Users

Appending a files contents to the end of a specific file name in several directories

Here is my dir structure: /tmp/dave/myappend.txt /tmp/dave/dir1/test.txt /tmp/dave/dir2/test.txt /tmp/dave/dir3/test.txt /tmp/dave/dir4/test.txt I want to append the contents of myappend.txt to the end of each file with the name "test.txt" in all dirs in /tmp/dave/ I have tried this:... (2 Replies)
Discussion started by: bigd213
2 Replies

8. Emergency UNIX and Linux Support

sed replace file contents by reading from another file

Hello, My input file1 is like this by tab-delimited chr1 mm10_knownGene stop_codon 3216022 3216024 0.000000 - . gene_id "uc007aeu.1"; transcript_id "uc007aeu.1"; chr1 mm10_knownGene CDS 3216025 3216968 0.000000 - 2 gene_id "uc007aeu.1"; transcript_id "uc007aeu.1"; ... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

9. Shell Programming and Scripting

ksh Script, Reading A File, Grepping A File Contents In Another File

So I'm stumped. First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes. I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies

10. Shell Programming and Scripting

Appending content of a file to another file before a specific character

Hi there, i've got a file with this content $ cat file1 Matt Mar The other file has the same number of lines with this content: $ cat file2 20404=767294 23450=32427 is there a way with either using sed, awk or paste to insert the content of file1 before the "=" character? So... (3 Replies)
Discussion started by: nms
3 Replies
JPEGTRAN(1)						      General Commands Manual						       JPEGTRAN(1)

NAME
jpegtran - lossless transformation of JPEG files SYNOPSIS
jpegtran [ options ] [ filename ] DESCRIPTION
jpegtran performs various useful transformations of JPEG files. It can translate the coded representation from one variant of JPEG to another, for example from baseline JPEG to progressive JPEG or vice versa. It can also perform some rearrangements of the image data, for example turning an image from landscape to portrait format by rotation. jpegtran works by rearranging the compressed data (DCT coefficients), without ever fully decoding the image. Therefore, its transforma- tions are lossless: there is no image degradation at all, which would not be true if you used djpeg followed by cjpeg to accomplish the same conversion. But by the same token, jpegtran cannot perform lossy operations such as changing the image quality. jpegtran reads the named JPEG/JFIF file, or the standard input if no file is named, and produces a JPEG/JFIF file on the standard output. OPTIONS
All switch names may be abbreviated; for example, -optimize may be written -opt or -o. Upper and lower case are equivalent. British spellings are also accepted (e.g., -optimise), though for brevity these are not mentioned below. To specify the coded JPEG representation used in the output file, jpegtran accepts a subset of the switches recognized by cjpeg: -optimize Perform optimization of entropy encoding parameters. -progressive Create progressive JPEG file. -restart N Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is attached to the number. -arithmetic Use arithmetic coding. -scans file Use the scan script given in the specified text file. See cjpeg(1) for more details about these switches. If you specify none of these switches, you get a plain baseline-JPEG output file. The quality setting and so forth are determined by the input file. The image can be losslessly transformed by giving one of these switches: -flip horizontal Mirror image horizontally (left-right). -flip vertical Mirror image vertically (top-bottom). -rotate 90 Rotate image 90 degrees clockwise. -rotate 180 Rotate image 180 degrees. -rotate 270 Rotate image 270 degrees clockwise (or 90 ccw). -transpose Transpose image (across UL-to-LR axis). -transverse Transverse transpose (across UR-to-LL axis). The transpose transformation has no restrictions regarding image dimensions. The other transformations operate rather oddly if the image dimensions are not a multiple of the iMCU size (usually 8 or 16 pixels), because they can only transform complete blocks of DCT coefficient data in the desired way. jpegtran's default behavior when transforming an odd-size image is designed to preserve exact reversibility and mathematical consistency of the transformation set. As stated, transpose is able to flip the entire image area. Horizontal mirroring leaves any partial iMCU column at the right edge untouched, but is able to flip all rows of the image. Similarly, vertical mirroring leaves any partial iMCU row at the bottom edge untouched, but is able to flip all columns. The other transforms can be built up as sequences of transpose and flip opera- tions; for consistency, their actions on edge pixels are defined to be the same as the end result of the corresponding transpose-and-flip sequence. For practical use, you may prefer to discard any untransformable edge pixels rather than having a strange-looking strip along the right and/or bottom edges of a transformed image. To do this, add the -trim switch: -trim Drop non-transformable edge blocks. Obviously, a transformation with -trim is not reversible, so strictly speaking jpegtran with this switch is not lossless. Also, the expected mathematical equivalences between the transformations no longer hold. For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim followed by -rot 180 -trim trims both edges. -perfect If you are only interested in perfect transformations, add the -perfect switch. This causes jpegtran to fail with an error if the transformation is not perfect. For example, you may want to do (jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg | pnmflip -r90 | cjpeg) to do a perfect rotation, if available, or an approximated one if not. -crop WxH+X+Y Crop the image to a rectangular region of width W and height H, starting at point X,Y. The lossless crop feature discards data out- side of a given image region but losslessly preserves what is inside. Like the rotate and flip transforms, lossless crop is restricted by the current JPEG format; the upper left corner of the selected region must fall on an iMCU boundary. If it doesn't, then it is silently moved up and/or left to the nearest iMCU boundary (the lower right corner is unchanged.) Other not-strictly-lossless transformation switches are: -grayscale Force grayscale output. This option discards the chrominance channels if the input image is YCbCr (ie, a standard color JPEG), resulting in a grayscale JPEG file. The luminance channel is preserved exactly, so this is a better method of reducing to grayscale than decompression, conver- sion, and recompression. This switch is particularly handy for fixing a monochrome picture that was mistakenly encoded as a color JPEG. (In such a case, the space savings from getting rid of the near-empty chroma channels won't be large; but the decoding time for a grayscale JPEG is substantially less than that for a color JPEG.) jpegtran also recognizes these switches that control what to do with "extra" markers, such as comment blocks: -copy none Copy no extra markers from source file. This setting suppresses all comments and other excess baggage present in the source file. -copy comments Copy only comment markers. This setting copies comments from the source file but discards any other data that is inessential for image display. -copy all Copy all extra markers. This setting preserves miscellaneous markers found in the source file, such as JFIF thumbnails, Exif data, and Photoshop settings. In some files, these extra markers can be sizable. The default behavior is -copy comments. (Note: in IJG releases v6 and v6a, jpegtran always did the equivalent of -copy none.) Additional switches recognized by jpegtran are: -maxmemory N Set limit for amount of memory to use in processing large images. Value is in thousands of bytes, or millions of bytes if "M" is attached to the number. For example, -max 4m selects 4000000 bytes. If more space is needed, temporary files will be used. -outfile name Send output image to the named file, not to standard output. -verbose Enable debug printout. More -v's give more output. Also, version information is printed at startup. -debug Same as -verbose. EXAMPLES
This example converts a baseline JPEG file to progressive form: jpegtran -progressive foo.jpg > fooprog.jpg This example rotates an image 90 degrees clockwise, discarding any unrotatable edge pixels: jpegtran -rot 90 -trim foo.jpg > foo90.jpg ENVIRONMENT
JPEGMEM If this environment variable is set, its value is the default memory limit. The value is specified as described for the -maxmemory switch. JPEGMEM overrides the default value specified when the program was compiled, and itself is overridden by an explicit -maxmemory. SEE ALSO
cjpeg(1), djpeg(1), rdjpgcom(1), wrjpgcom(1) Wallace, Gregory K. "The JPEG Still Picture Compression Standard", Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. AUTHOR
Independent JPEG Group This file was modified by The libjpeg-turbo Project to include only information relevant to libjpeg-turbo and to wordsmith certain sec- tions. BUGS
The transform options can't transform odd-size images perfectly. Use -trim or -perfect if you don't like the results. The entire image is read into memory and then written out again, even in cases where this isn't really necessary. Expect swapping on large images, especially when using the more complex transform options. 1 January 2013 JPEGTRAN(1)
All times are GMT -4. The time now is 09:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy