Sponsored Content
Top Forums Shell Programming and Scripting Difficulty cleaning references to duplicated images in HTML code Post 302763833 by RudiC on Wednesday 30th of January 2013 01:35:53 PM
Old 01-30-2013
OK, try this very crude approach, which may need serious polishing:
Code:
awk -F, 'NR==FNR {Ar[$1]=Ar[$1](Ar[$1]?"|":"")$2;
                  if (!Rr[$1])Rr[$1]=$2; next}
         {for (i in Ar) gsub (Ar[i], Rr[i])}
         1
        ' file file1
<!-- group 0 -->
<img src="13429.png" />...text...<img src="13429.png" />...text...<img src="13429.png" />

<!-- group 1 -->
<img src="14136.png" />...text...<img src="14136.png" />...text...<img src="14136.png" />...text...<img src="14136.png" />

<!-- group 2 -->
<img src="21560.png" />...text...<img src="21560.png" />

This User Gave Thanks to RudiC For This Post:
 

8 More Discussions You Might Find Interesting

1. Programming

how can compile cpp code containing references to java classes

hi there is example (on link given below )of such code that contains java class reference in c++ program. http://slackware.cs.utah.edu/pub/slackware/slackware-7.1/docs/Linux-HOWTO/Process-Monitor-HOWTO I am new in linux environment. and not able to compile it. when i compile it through... (1 Reply)
Discussion started by: surinder
1 Replies

2. Web Development

html link to images in /tmp directory

Because of permission issues, I need to link to images in my web page which are stored in /tmp which of course is located in the root directory but my actual html page is much further down in another directory. I thought the the following code should work, but the image comes up as a broken link:... (2 Replies)
Discussion started by: Solerous
2 Replies

3. Shell Programming and Scripting

Referring to attached images in html email body through mailx

encoding type for images? (5 Replies)
Discussion started by: biswasbaishali
5 Replies

4. Shell Programming and Scripting

SED help - cleaning up code, extra spaces won't go away

Hello, W/in the script I'm working on, I have a need to take a column from a file, and format it so I can have a variable that will egrep for & invert the regex from another file. My solution is this: VAR=`awk -F, '{print $2}' $FAIL | sed 's/-i/\|/g'` VAR2=`echo $VAR | sed 's/... (5 Replies)
Discussion started by: Matthias03
5 Replies

5. Shell Programming and Scripting

Cleaning AWK code

Hi I need some help to clean my code used to get city location. wget -q -O - http://www.ip2location.com/ | grep chkRegionCity | awk 'END { print }' | awk -F"" '{print $4}' It gives me the city but have a leading space. I am sure this could all be done by one single AWK Also if possible... (8 Replies)
Discussion started by: Jotne
8 Replies

6. UNIX and Linux Applications

[solved]Moving server...need to find all hard code IP references

I'm moving my web server to a different datacenter. OS is CentOS 5.8 Apache 2.2.3 qmail NcFTPd Its been 12 years since I relocated a server. Lots of brain cells lost since then...:-) I need to identify all the config files that contain the server's IP addresses. Memory has provided... (0 Replies)
Discussion started by: scasey
0 Replies

7. Shell Programming and Scripting

Bash Script to find/sort/move images/duplicate images from USB drive

Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist... (1 Reply)
Discussion started by: JonaQuinn
1 Replies

8. Web Development

Changing Images in HTML

Hi, I recently bought shared hosting at asphostportal.com. Now, I have little problem. Could you help me please? How to change the images after every 5 seconds in html? The images should display in the same places for every 5 seconds? can anybody send me code please. Thanks. (4 Replies)
Discussion started by: minnawanda
4 Replies
THUMBNAIL(1)						      General Commands Manual						      THUMBNAIL(1)

NAME
thumbnail - create a TIFF file with thumbnail images SYNOPSIS
thumbnail [ options ] input.tif output.tif DESCRIPTION
thumbnail is a program written to show how one might use the SubIFD tag (#330) to store thumbnail images. thumbnail copies a TIFF Class F facsimile file to the output file and for each image an 8-bit greyscale thumbnail sketch. The output file contains the thumbnail image with the associated full-resolution page linked below with the SubIFD tag. By default, thumbnail images are 216 pixels wide by 274 pixels high. Pixels are calculated by sampling and filtering the input image with each pixel value passed through a contrast curve. OPTIONS
-w Specify the width of thumbnail images in pixels. -h Specify the height of thumbnail images in pixels. -c Specify a contrast curve to apply in generating the thumbnail images. By default pixels values are passed through a linear contrast curve that simply maps the pixel value ranges. Alternative curves are: exp50 for a 50% exponential curve, exp60 for a 60% exponen- tial curve, exp70 for a 70% exponential curve, exp80 for a 80% exponential curve, exp90 for a 90% exponential curve, exp for a pure exponential curve, linear for a linear curve. BUGS
There are no options to control the format of the saved thumbnail images. SEE ALSO
tiffdump(1), tiffgt(1), tiffinfo(1), libtiff(3) Libtiff library home page: http://www.remotesensing.org/libtiff/ libtiff November 2, 2005 THUMBNAIL(1)
All times are GMT -4. The time now is 11:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy