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 gkittelson 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: *

  1. xxalex

    Creating links from a string

    Cheers for the comments. I noticed the photoinfo div problem when I installed firefox there; should be easy enough to fix. It's not happening in Safari or Opera. I fear testing it in internet explorer.
  2. xxalex

    Creating links from a string

    Thanks rhyno! That has worked a treat. If you wanna have a look at the gallery you can see it at http://japan.traceramc.co.uk 2 mysql tables, 3 php pages - hopfully hundreds of holiday photos! Cheers for your help. Alex
  3. xxalex

    Creating links from a string

    Hello. I am putting together a php photo gallery and have a field in the mysql database called photoKeywords. This contains some comma delimited keywords for each photo. eg. Cityname, Countryname, Peoplename I have created a search page that displays all the photos, captions and keywords that...
  4. xxalex

    Help with extracting data based on common field in 2 files

    Hey Just wanted to say thanks for all of your help. Futurelet, your script works great, I like how I can specify input and output files when I call the script... I must write like this in the future. Cheers Alex ps. PHV, sorry I got your name wrong in so many of the posts, I was a bit...
  5. xxalex

    Help with extracting data based on common field in 2 files

    Thanks PVH, that worked. I'll compare the two and find what you changed. Cheers Alex
  6. xxalex

    Help with extracting data based on common field in 2 files

    Just to add, Fulurelet's and PVH's scripts only return the last occurance of any grid reference to the output file. eg. If the input file looked like this... BT04 1LG,UniqueID1,Type1 BT19 6SF,UniqueID2,Type1 BT19 6SF,UniqueID3,Type2 BT04 1LG,UniqueID4,Type2 BT04 1LG,UniqueID5,Type3 BT19...
  7. xxalex

    Help with extracting data based on common field in 2 files

    This script was suggested by a friend: #!/bin/sh out=results.txt > $out while read xx1 xx2 ; do POSTCODE="`echo $xx1 $xx2 | sed 's|,.*||'`" UniqueID=`echo $xx2 | sed 's|...,||' | sed 's|,.*||'` Type=`echo $xx2 | sed 's|.*,.*,||'` # echo POSTCODE=$POSTCODE UniqueID=$UniqueID...
  8. xxalex

    Help with extracting data based on common field in 2 files

    Thanks futurelet, I'll print that off tomorrow :-)
  9. xxalex

    Help with extracting data based on common field in 2 files

    Futurelet, Your code worked a treat. I'm gonna run it on some known datasets and then work out how to write like that myself for the next time I need it. Thanks! PHV, With NR==FNR as supplied by vgersh99 your code works too. Thanks! There seem to be so many ways of doing these things. Now I...
  10. xxalex

    Help with extracting data based on common field in 2 files

    Thanks for the quick reply PH, When I run that code I get a blank results file. I don't know how to debug it because I don't understand it. #!/bin/bash awk -F',' ' NR=FNR{a[$1]=$2","$3;next} $1 in a{print a[$1]","$2","$3} ' input.txt database.txt > results.txt When i run this from the command...
  11. xxalex

    Help with extracting data based on common field in 2 files

    Hello, This is my first post. I have a problem that I have nearly solved, I need some help to complete it. I have 2 files. input.txt (6000 lines) looks like this: BT04 1LG,UniqueID1,Type1 BT19 6SF,UniqueID2,Type1 BT22 4PT,UniqueID3,Type2 BT19 5SF,UniqueID4,Type2 database.txt (750,000 lines)...

Part and Inventory Search

Back
Top