Sponsored Content
Top Forums Shell Programming and Scripting using perl for matching one file with another file and print into new line Post 302300731 by KevinADC on Wednesday 25th of March 2009 12:12:03 AM
Old 03-25-2009
Maybe summer cherry understood the relationship between the two files and your output, but I don't.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Identify matching data in a file and output to original line, in perl

Hi, I haven't done this for awhile, and further, I've never done it in perl so I appreciate any help you can give me. I have a file of lines, each with 5 data points that look like this: AB,N,ALLIANCEBERNSTEIN HLDNG L.P,AB,N ALD,N,ALLIED CAPITAL CORPORATION,ALD,N AFC,N,ALLIED CAPITAL... (4 Replies)
Discussion started by: Pcushing
4 Replies

2. Shell Programming and Scripting

How to print file without few exactly matching lines?

Hi I have a very long file with 4 columns of numbers for example 1875 1876 12725 12723 13785 13786 4232 4230 13184 13185 ... (2 Replies)
Discussion started by: ananyob
2 Replies

3. Shell Programming and Scripting

Print matching lines in a file

Hello everyone, I have a little script below: die "Usage infile outfile reGex" if @ARGV != 3; ($regex) = @ARGV; open(F,$ARGV) or die "Can't open"; open(FOUT,"+>$ARGV") or die "Can't open"; while (<F>) { print FOUT if /$regex/.../$regex/; } No matter what I give $regex on the... (2 Replies)
Discussion started by: new bie
2 Replies

4. Shell Programming and Scripting

Match a line in File 1 with Column in File 2 and print whole line in file 2 when matched

Hi Experts, I am very new to scripting and have a prb since few days and it is urgent to solve so much appreciated if u help me. i have 2 files file1.txt 9647810043118 9647810043126 9647810043155 9647810043161 9647810043166 9647810043185 9647810043200 9647810043203 9647810043250... (22 Replies)
Discussion started by: mustafa.abdulsa
22 Replies

5. Shell Programming and Scripting

Replace line in file with line in another file based on matching string

Hi I am not the best scripter in the world and have run into a issue which you might be able to guide me on... I have two files. File1 : A123, valueA, valueB B234, valueA, valueB C345, valueA, valueB D456, valueA, valueB E567, valueA, valueB F678, valueA, valueB File2: C345,... (5 Replies)
Discussion started by: luckycharm
5 Replies

6. Shell Programming and Scripting

Replace and add line in file with line in another file based on matching string

Hi, I want to achieve something similar to what described in another post: The difference is I want to add the line if the pattern is not found. File 1: A123, valueA, valueB B234, valueA, valueB C345, valueA, valueB D456, valueA, valueB E567, valueA, valueB F678, valueA, valueB ... (11 Replies)
Discussion started by: jyu3
11 Replies

7. Shell Programming and Scripting

Replace line in file with line in another file based on matching string

HI Can any one guide me how to achieve this task. I have 2 files env.txt #Configuration.Properties values identity_server_url = http://identity.test-hit.com:9783/identity/service/user/register randon_password_length = 6 attachment_file_path = /pass/temp/attachments/... (1 Reply)
Discussion started by: nikilbr86
1 Replies

8. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

9. Shell Programming and Scripting

awk to lookup stored variable in file and print matching line

The bash bash below extracts the oldest folder from a directory and stores it in filename That result will match a line in bold in input. In the matching line there is an_xxx digit in italics that (once the leading zero is removed) will match a line in link. That is the lint to print in output.... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

awk to update file with partial matching line in another file and append text

In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
Discussion started by: cmccabe
4 Replies
HPFTODIT(1)						      General Commands Manual						       HPFTODIT(1)

NAME
hpftodit - create font description files for use with groff -Tlj4 SYNOPSIS
hpftodit [ -adqsv ] [ -in ] tfm_file map_file font It is possible to have whitespace between the -i option and its parameter. DESCRIPTION
hpftodit creates a font file for use with a Hewlett-Packard LaserJet 4-series (or newer) printer with groff -Tlj4, using data from an HP tagged font metric (TFM) file. tfm_file is the name of the TFM file for the font; Intellifont and TrueType TFM files are supported, but symbol set TFM files are not. map_file is a file giving the groff names for characters in the font; this file should consist of a sequence of lines of the form: m u c1 c2 ... [ # comment ] where m is a decimal integer giving the MSL number of the character, u is a hexadecimal integer giving the Unicode value of the character, and c1, c2, ... are the groff names of the character. The values can be separated by any whitespace; the Unicode value must use uppercase digits A-F, and must be without a leading `0x', `u', or `U+'. Unicode values corresponding to composite glyphs are decomposed; e.g., `u00C0' becomes `u0041_0300'. The name for a glyph without a groff name may be given as uXXXX if the glyph corresponds to a Unicode value, or as an unnamed glyph `---'. If the given Unicode value is in the Private Use Area (0xE000-0xF8FF), the glyph is included as an unnamed glyph. Refer to groff_diff(1) for additional information about unnamed glyphs and how to access them. Blank lines and lines beginning with `#' are ignored. A `#' following one or more groff names begins a comment. Because `#' is a valid groff name, it must appear first in a list of groff names if a comment is included, e.g., 3 0023 # # number sign or 3 0023 # sh # number sign rather than 3 0023 sh # # number sign which will treat the first `#' as the beginning of the comment. font is the name of the groff font file. The groff font file is written to font; if font is specified as `-', the output is written to the standard output. The -s option should be given if the font is special (a font is special if troff should search it whenever a character is not found in the current font). If the font is special, it should be listed in the fonts command in the DESC file; if it is not special, there is no need to list it, since troff can automatically mount it when it's first used. If the -i option is used, hpftodit automatically will generate an italic correction, a left italic correction and a subscript correction for each character (the significance of these parameters is explained in groff_font(5)). OPTIONS
-a Include characters in the TFM file that are not included in the map file. A glyph with corresponding Unicode value is given the name uXXXX; a glyph without a Unicode value is included as an unnamed glyph `---'. A glyph with a Unicode value in the Private Use Area (0xE000-0xF8FF) also is included as an unnamed glyph. This option provides a simple means of adding Unicode-named and unnamed glyphs to a font without including them in the map file, but it affords little control over which glyphs are placed in a regular font and which are placed in a special font. The presence or absence of the -s option has some effect on which glyphs are included: without the -s option, only the "text" symbol sets are searched for matching glyphs; with the -s option, only the "mathematical" symbol sets are searched. Nonetheless, restricting the symbol sets searched isn't very selective--many glyphs are placed in both regular and special fonts. Normally, the -a option should be used only as a last resort. -d Dump information about the TFM file to the standard output; this option can be useful for ensuring that a TFM file is a proper match for a font, and that the contents of the TFM file are suitable. The information includes the values of important TFM tags, and a listing (by MSL number for Intellifont TFM files or by Unicode value for TrueType TFM files) of the glyphs included in the TFM file. The unit of measure `DU' for some tags indicates design units; there are 8782 design units per em for Intellifont fonts, and 2048 design units per em for TrueType fonts. Note that the accessibility of a glyph depends on its inclusion in a symbol set; some TFM files list many glyphs but only a few symbol sets. The glyph listing includes the glyph index within the TFM file, the MSL or Unicode value, and the symbol set and character code that will be used to print the glyph. If map_file is given, groff names are given for matching glyphs. If only the glyph index and MSL or Unicode value are given, the glyph does not appear in any supported symbol set and cannot be printed. With the -d option, map_file is optional, and font is ignored if given. -q Suppress warnings about characters in the map file that were not found in the TFM file. Warnings never are given for unnamed glyphs or by glyphs named by their Unicode values. This option is useful when sending the output of hpftodit to the standard output. -v Print the hpftodit version number. -s The font is special. This option adds the special command to the font file, and affects the order in which HP symbol sets are searched for each glyph. Without the -s option, the "text" sets are searched before the "mathematical" symbol sets. With the -s option, the search order is reversed. -in Generate an italic correction for each character so that the character's width plus the character's italic correction is equal to n thousandths of an em plus the amount by which the right edge of the character's bounding is to the right of the character's origin. If this would result in a negative italic correction, use a zero italic correction instead. Also generate a subscript correction equal to the product of the tangent of the slant of the font and four fifths of the x-height of the font. If this would result in a subscript correction greater than the italic correction, use a subscript correction equal to the italic correction instead. Also generate a left italic correction for each character equal to n thousandths of an em plus the amount by which the left edge of the character's bounding box is to the left of the character's origin. The left italic correction may be negative. This option normally is needed only with italic or oblique fonts; a value of 50 (0.05 em) usually is a reasonable choice. FILES
/usr/share/groff/1.19.2/font/devlj4/DESC Device description file. /usr/share/groff/1.19.2/font/devlj4/F Font description file for font F. /usr/share/groff/1.19.2/font/devlj4/generate/*.map Symbol mapping files SEE ALSO
groff(1), groff_diff(1), grolj4(1), groff_font(5), lj4_font(5) Groff Version 1.19.2 14 January 2004 HPFTODIT(1)
All times are GMT -4. The time now is 09:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy