Sponsored Content
Top Forums Shell Programming and Scripting Put numbers against the words Post 302539917 by radoulov on Tuesday 19th of July 2011 05:52:05 AM
Old 07-19-2011
If I'm not missing something, this should work:

Code:
awk 'END { process( f ) }
FNR == 1 {      
  if ( f ) process( f )
  f = FILENAME
  sub( /\.dic$/, x, f )
  }
getline num < (f ".fil") { map[$0] = num }
func process( f ) {
  while (( getline dat < ( f ".dat" )) > 0 ) {
    print map[dat] > ( f ".num" )
    }
  close( f ".dat" ); close( f ".fil" )
  close( f ".num" ); split( x, map )      
  }' *dic

This User Gave Thanks to radoulov For This Post:
 

10 More Discussions You Might Find Interesting

1. Web Development

Query to print numbers in words

Hi, If i give a number say "1234" the output of mysql query should be: one thousand and twenty four How to write mysql query for this? With regards Vanitha (5 Replies)
Discussion started by: vanitham
5 Replies

2. Shell Programming and Scripting

Extract numbers below words with awk

Hi all, Please some help over here. I have a Sales.txt file containing info in blocks for every sold product in the pattern showed below (only for 2 products). NEW BLOCK SALE DATA PRODUCT SERIAL 79833269999 146701011945004 .Some other data .Some... (17 Replies)
Discussion started by: cgkmal
17 Replies

3. Shell Programming and Scripting

Query to print numbers in words

Hi, I have to write a shell script that converts numbers in to words below is what i wrote.My script is not running. ----------------------------------- echo -n "Enter number : " read n len= echo $n | wc -c echo " number in words : " for ( i=1; i<len; i++ ) do num=echo $n... (5 Replies)
Discussion started by: bab123
5 Replies

4. Shell Programming and Scripting

Difference between words and not between numbers

Hi, Sorry in advance for propably a silly question, but I am a bit lost. On some of the linux job flow I have the following check: if ($file != 1500) then echo ERROR It works ok, all times $file is not equal to 1500 I have the error message. I try to do something similar... (7 Replies)
Discussion started by: essemario
7 Replies

5. UNIX for Dummies Questions & Answers

Trying to sort words and numbers associated with them.

Hi. I have a file containing words and numbers associated with them as follows - c 2 b 5 c 5 b 6 a 10 b 16 c 18 a 19 b 21 c 27 a 28 b 33 a 76 a 115 c 199 c 251 a 567 a 1909 (4 Replies)
Discussion started by: maq
4 Replies

6. Shell Programming and Scripting

Adding numbers matching with words

Hi All, I have a file which looks like this: abc 1 abc 2 abc 3 abc 4 abc 5 bcd 1 bcd 3 bcd 3 bcd 5 cde 7 This file is just a miniature version of what I really have. Original file is some 1 million lines long. I have tried to come up with the code for what I wish to accomplish... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

7. Shell Programming and Scripting

Put double quotes around numbers

Hi, consider a file which has data such as "random text",912345,"54","finish" "random text",9991236745,"9954","finish" I want to replace the numbers that don't have double quotes around them with ones that do; so the output should be "random text","912345","54","finish" "random... (4 Replies)
Discussion started by: Storms
4 Replies

8. Shell Programming and Scripting

help needed to put instance numbers

Hi All I need help am having a source file as below emp dept class subclass region country division first i need to get line count and i need to divide by 3 it is an parameter passing value number of lines 7 (8 Replies)
Discussion started by: ragu.selvaraj
8 Replies

9. Shell Programming and Scripting

Put words to fix position in a file

Hi all, There are several lines in my file as a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=44 a=3,b=dene,c=22,d=23422342334,g=vxcvxcv,h=4 a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=678 I take values with this command awk -F '' '{print $1,$2,$3}' a.txt I want to put values to a fix position... (6 Replies)
Discussion started by: bahadiraktan
6 Replies

10. Shell Programming and Scripting

Put numbers after word

Hello I have an file with this content -------------------------------------------- timer one timer two timer three timer four timer five timer six timer seven ------------------------------------------- And I want the following output.... (4 Replies)
Discussion started by: thailand
4 Replies
NSIS(1) 							      GenPat								   NSIS(1)

NAME
GenPat - A program to create patch files in VPatch format. SYNOPSIS
GenPat [-R] [-B=64] [-V] [-O] [-A=500] [source] [target] [patch.pat] DESCRIPTION
This manual page documents briefly the GenPat command. This manual page was written for the Debian (TM) distribution because the original program does not have a manual page. Instead, it has documentation in the HTML format; see below. GenPat is a program that creates installer programs for Windows. OPTIONS
-R Replace a patch with same contents as source silently if it already exists. -B=64 Set blocksize (default=64), multiple of 2 is required. -V More verbose information during patch creation. -O Deactivate match limit of the -A switch (sometimes smaller patches). -A=500 Maximum number of block matches per block (improves performance). Default is 500, larger is slower. Use -V to see the cut-off aborts. EXIT STATUS
0 Success 1 Arguments missing 2 Other error 3 Source file already has a patch in specified patch file (=error) SEE ALSO
GenPat is documented more fully in the HTML file /usr/share/doc/nsis/Docs/VPatch/Readme.html. AUTHOR
This manual page was written by Paul Wise pabs@debian.org for the Debian (TM) system. AUTHOR
Paul Wise Created man page COPYRIGHT
Copyright (C) 2005 Paul Wise GenPat manual October 5, 2005 NSIS(1)
All times are GMT -4. The time now is 05:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy