Sponsored Content
Top Forums Shell Programming and Scripting Compare an item in one line of a file against an item in the next line of the same file Post 303045897 by vgersh99 on Friday 17th of April 2020 12:54:24 PM
Old 04-17-2020
could you provide a sample/representative snapshot of your input file inputfile and a desired output.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Searching for file and stopping at first item found

Hello, I try to write a shell script that would list all files on a directory and stop when it finds the first item specified on a find or ls command. How can I tell to the find or ls command to stop when it finds the first ".doc" file for example ? Thank you (7 Replies)
Discussion started by: davchris
7 Replies

2. Shell Programming and Scripting

Reading each item from a formatted file

Hi, I have a file generated like this - 1. Fire SQL and store the formatted output in a temp file echo "select path, empid, age from emp_tbl" | /usr/sql emp_db 2 > count_file | grep vol > tempFile 2. The tempFile looks like this after the above statement /vol/emp1 0732 ... (9 Replies)
Discussion started by: angshuman_ag
9 Replies

3. Shell Programming and Scripting

Print new item in file with symbol

Dear all, I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this andrew 80 ben 75 and the next input is carine 90. So the problem here is i want to print... (2 Replies)
Discussion started by: branred
2 Replies

4. Programming

Storing C++-struct in file - problem when adding new item in struct

Hi, I have received an application that stores some properties in a file. The existing struct looks like this: struct TData { UINT uSizeIncludingStrings; // copy of Telnet data struct UINT uSize; // basic properties: TCHAR szHost; //defined in Sshconfig UINT iPortNr; TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies

5. Shell Programming and Scripting

how to compare file line by line with awk

im a newbee to unix. I have a requirement to compare two files with awk. file1.txt a b c d e file2.txt a b d e here i want to compare each line in file1 with corresponding line in file2 and prinf the line with difference. ie to check required result as shown below a=a (dont... (3 Replies)
Discussion started by: kiranps
3 Replies

6. Shell Programming and Scripting

How to read file line by line and compare subset of 1st line with 2nd?

Hi all, I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like: <date1>|<data1>|<url1>|<result1> <date2>|<data2>|<url2>|<result2> <date3>|<data3>|<url3>|<result3> <date4>|<data4>|<url4>|<result4> What I... (3 Replies)
Discussion started by: pat_pramod
3 Replies

7. Shell Programming and Scripting

Read a lis, find items in a file from the list, change each item

Hello, I have some tab delimited text data, file: final_temp1 aname val NAME;r'(1,) 3.28584 r'(2,)<tab> NAME;r'(3,) 6.13003 NAME;r'(4,) 4.18037 r'(5,)<tab> You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

8. Shell Programming and Scripting

How to compare previous and current item in for loop in bash?

Hey, I am trying to compare formated login and logout dates from one user at a host which I have stored in a tmp directory in order to find out the total login time. I need to compare them in order to find overlapping intervals. At first I tried to store each log in and logo date in an array... (3 Replies)
Discussion started by: Mumu123
3 Replies

9. UNIX for Beginners Questions & Answers

Zabbix item for last line of a log file

Dear all,Zabbix version : 2.4 (yes, I know, upgrading soon - honest) Server OS version : CentOS 6, 64-bit (CentOS 7 with the Zabbix upgrade)I've got a large log file that I would like to read by an external process. It's basically the same as reading the item value on a web-page. I have... (5 Replies)
Discussion started by: rbatte1
5 Replies

10. Shell Programming and Scripting

Script to process a list of items and uncomment lines with that item in a second file

Hello, I have a src code file where I need to uncomment many lines. The lines I need to uncomment look like, C CALL l_r(DESNAME,DESOUT, 'Gmax', ESH(10), NO_APP, JJ) The comment is the "C" in the first column. This needs to be deleted so that there are 6 spaces preceding "CALL".... (7 Replies)
Discussion started by: LMHmedchem
7 Replies
pdfposter(1)															      pdfposter(1)

NAME
pdfposter - Scale and tile PDF images/pages to print on multiple pages. SYNOPSIS
pdfposter <options> infile outfile DESCRIPTION
Pdfposter can be used to create a large poster by building it from multple pages and/or printing it on large media. It expects as input a PDF file, normally printing on a single page. The output is again a PDF file, maybe containing multiple pages together building the poster. The input page will be scaled to obtain the desired size. The program uses a simple but efficient method which is possible with PDF: All new pages share the same data stream of the scaled page. Thus resulting file grows moderatly. To control its operation, you need to specify either the size of the desired poster or a scale factor for the image: o Given the poster size, it calculates the required number of sheets to print on, and from that a scale factor to fill these sheets opti- mally with the input image. o Given a scale factor, it derives the required number of pages from the input image size, and positions the scaled image centered on this area. OPTIONS
General Options --version Show program's version number and exit -h , --help Show help message and exit --help-media-names List available media and disctance names and exit -v , --verbose Be verbose. Tell about scaling, rotation and number of pages. Can be used more than once to increase the verbosity. -n , --dry-run Show what would have been done, but do not generate files. Defining Output -m BOX, --media-size=BOX Specify the desired media size to print on. See below for BOX. The default is A4 in the standard package. -p BOX, --poster-size=BOX Specify the poster size. See below for BOX. pdfposter will autonomously choose scaling and rotation to best fit the input onto the poster (see EXAMPLES below). If you give neither the -s nor the -p option, the default poster size is identical to the media size. -s NUMBER Specify a linear scaling factor to produce the poster. Together with the input image size and optional margins, this induces an output poster size. So don't specify both -s and -p. Default is deriving the scale factor to fit a given poster size. Box Definition The BOX mentioned above is a specification of horizontal and vertical size. The syntax is as follows (with multipier being specified optionally): box = [ multiplier ] unit multiplier = number "x" number unit = medianame or distancename Many international media names are recognised by the program, in upper and lower case, and can be shortened to their first few characters, as long as unique. For instance 'A0', 'Let'. Distance names are like 'cm', 'inch', 'ft'. Medias are typically not quadratic but rectangular, which means width and hight differ. Thus using medianames is a bit tricky: 10x20cm obviuos: 10 cm x 20 cm (portrait) 20x10cm same as 10x20cm, since all boxes are rotated to portrait format Now when using medianames it gets tricky: 1x1a4 same as approx. 21x29cm (21 cm x 29 cm, portrait) 1x2a4 same as approx. 21x58cm (21 cm x 58 cm, portrait) This are two a4 pages put together at the small side: One portrait page wide and two portrait pages high. 2x1a4 same as approx. 42x29cm, which is rotated to portrait and is the same a 29x42cm (29 cm x 42 cm) This are two a4 pages put together at the long side: Two portrait pages wide and one portrait page high. EXAMPLES
pdfposter -mA3 -pA0 a4.pdf out.pdf Prints an A4 input file on 8 A3 pages, forming an A0 poster. pdfposter -p3x3Let a4.pdf out.pdf Prints an inputfile on a poster of 3x3 Letter pages. pdfposter -mA0 input.pdf out.pdf Enlarges an inputfile to print on a large-media A0 capable device. pdfposter -s4 input.pdf out.pdf Enlarge an inputfile exactly 4 times, print on the default A4 media, and let pdfposter determine the number of pages required. pdfposter -m10x10cm -pa0 a4.pdf out.pdf Just to show how efficient pdfposter is: This will create a file containing 192 pages, but only 15 times as big as the single page. With a4.pdf being a quite empty page, this ratio should be even better for filled pages. More examples including sample pictures can be found at http://pdfposter.origo.ethz.ch/wiki/examples Examples for automatic scaling o For printing 2 portrait A4 pages high (approx. 58cm) and let pdfposter determine how many portrait pages wide, specify a lage number of vertical pages. eg: pdfposter -p999x2a4 testpage-wide.pdf out.pdf o For printing 2 landscape A4 pages high (approx. 20cm) and let pdfposter determine how many landscape pages wide, specify a lage number of horizontal pages. eg: pdfposter -p2x999a4 testpage-wide.pdf out.pdf SEE ALSO
poster(1) Project Homepage http://pdfposter.origo.ethz.ch/ AUTHOR
Hartmut Goebel <h.goebel@goebel-consult.de> COPYRIGHT
GNU Public Licence v3 (GPLv3) Version 0.4.4 pdfposter(1)
All times are GMT -4. The time now is 06:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy