Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: will27
  • Content: Threads
  • Order by date
  1. will27

    a problem on matching with function index()

    Hey, all I have been struggling with problem for quite a while, any hints of librating me from the fight will be highly appreciated. first there is a file "pool", the first col is something with will be matched by some key WorldComInc WorldCom, Inc. second there is file "key_trace"...
  2. will27

    sed script work, oneliner not work, what's the problem?

    Hi, all suppose I have following txt file "people" Tim US Xue CHN Will US Tom US Yong CHN if I work with a sedscript as following: /US$/ { s//USA/ w us.origin_1 } then following code works sed -n -f sedscript people However, its oneliner version as below doesn't sed '/US$/ {s//USA/; w...
  3. will27

    Find max and min by using array, get problem

    Hi, all The data is like following: ############## data #################### time name price 20050616 company2 32 19900112 company1 39 19980223 company2 44 20060523 company1 55 ############# job to be done ################ the job is simple, find the starting...
  4. will27

    how to pass parameters into regular expression, i.e., /parameter/

    Hi, all I have been trying to find a way to pass parameters into regular expression, failed, so I am back. for example, I have following two files: # firstfile USA US United_States_of_America # secondfile x company USA US y Company xyz United_States_of_America what I want is to pass...
  5. will27

    use key to extract, extracted file has more keys than used to extract

    Hi, all I get many keys to extract records in other files. However, following scripts doesn't spell out what I expected. Both the keyfile and to be extracted files are tab dlimited. # keys in three column for keycol in 1 2 3 do # creat a vector...
  6. will27

    unconstant NF, want fields 1 to (NF-1) printed on same line.

    Dear all I am sure this is a simple quesiton for most people visiting this forum. the question in detail is as following: A data file with unconstant NF, the fields I want to reserve is field 1 to field (NF-1), they should be printed out on the same row. for example thank you for your kind...
  7. will27

    matching-by-key program unstable,any possible reason?

    Dear all What follows is a simple awk program with a shell wrapper. The problem is sometimes it works fine and sometime it won't. ########################################################## for ((i=1990;i<=2006;i++)) do awk 'BEGIN{FS=OFS="\t"} {if ($2==m) print $1,$3,$4}' m=$i GI> tmpGI awk...
  8. will27

    match by key, same code for files &quot;same format&quot;, one works one fails

    Dear all, I use following codes to join two tab delimited files and print out wanted columns. for both files, the key is at the 4th cols. the codes work for following two files, let me call them "wf1" and "wf2" first the codes: awk -F"\t" '{while((getline<"'wf2'")>0) f2[$4]=$4;OFS="\t"} {if...
  9. will27

    hwo to use awk to collect information in mutiple records

    Dear all: I am new to awk and hope to know an efficient way to achieve following object: suppose the dataset is as following: a 40 b 10 c 10 c 20 b 20 c 30 a 30 c 20 what I want to do is first to collect information on a a 40 a 30 2nd, calculate a summary information...

Part and Inventory Search

Back
Top