Download images from the first column and rename it with the second column in a loop: Please help!
Dear Friends,
I have a very little knowledge on shell scripting. I am stuck with a problem for which I need an expert advice.
I have a .txt file "image_urls.txt" which contains the data like this
(h t t p urls above)
Since the images names are not unique they are getting overwritten as soon as its downloaded. So I want to rename the images in first column with the second column value (vin_series) in a loop (line by line), one by one image.
The renamed images will be there in the directory and mapped in the database.
Please help me on this.
Regards
Praveen
Last edited by Scrutinizer; 01-21-2013 at 05:34 AM..
Reason: code tags
I need help in what to do with a bash script? I'm trying to run a command to output the data from a table and then insert it into commands. Looping for each row of data.
For example the output data from a table:
10 John house
20 Jane apt
30 Joe townhomeThen I need to take the output... (1 Reply)
Hi, Iam new to unix. I have one input file .
Input file :
ID1~Name1~Place1
ID2~Name2~Place2
ID3~Name3~Place3
I need output such that only first column should change to fixed width column of 15 characters of length.
Output File:
ID1<<12 spaces>>Name1~Place1
ID2<<12... (5 Replies)
Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2
file 1 sample
SNDK 80004C101 AT
XLNX 983919101 BB
NETL 64118B100 BS
AMD 007903107 CC
KLAC 482480100 DC
TER 880770102 KATS
ATHR 04743P108 KATS... (7 Replies)
Hello all,
this should really be easy for you... I need AWK to print column maxima for each column of such input:
Input:
1 2 3 1
2 1 1 3
2 1 1 2
Output should be:
2 2 3 3
This does the sum, but i need max instead:
{ for(i=1; i<=NF; i++)
sum +=$i }
END {for(i=1; i in sum;... (3 Replies)
Hi All,
I have a file example.csv which looks like this
GrpID,TargetID,Signal,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777
I want the output as
GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num
CSCH74_1_1,2007,61,256... (4 Replies)
Hi All,
I have a file example.csv which looks like this
GrpID,TargetID,Signal,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777
I want the output as
GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num
CSCH74_1_1,2007,61,256... (1 Reply)
This is my input file :
# cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9
This is the required output
... (1 Reply)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hi all,
I have searched and searched, but I have not found a solution that quite fits what I am trying to do.
I have a long list of data in three columns. Below is a sample:
1,10,8
2,12,10
3,13,12
4,14,14
5,15,16
6,16,18
Please use code tags
What I need to do is as follows: If a... (4 Replies)
Discussion started by: bleedingturnip
4 Replies
LEARN ABOUT DEBIAN
tp-magic-config
TP-MAGIC-CONFIG(1) tp-magic-config TP-MAGIC-CONFIG(1)NAME
tp-magic-config -- Helps creating 'Magic' tool plugins for Tux Paint(1)SYNOPSYS
tp-magic-config [--apiversion | --version | --cflags | --pluginprefix | --plugindocprefix | --dataprefix | --localpluginprefix | --local-
dataprefix]
DESCRIPTION
tp-magic-config is a simple shell script that responds with various pieces of information about the currently-installed version of Tux
Paint(1) that are useful when building 'Magic' tool plugins.
OPTIONS --apiversion
Outputs the version of the Tux Paint 'Magic' tool plugin API that the installed copy of Tux Paint supports. (For API compatibility
testing.)
--version
Outputs the version of Tux Paint that tp-magic-config corresponds to.
--cflags
Outputs the compiler flags that Tux Paint 'Magic' tool plugins should be compiled with. (For example, a "-I" include path option
that tells the compiler where it can find the plugin API header file, "tp_magic_config.h", that plugins must #include.)
--pluginprefix
Outputs the system directory where the installed copy of Tux Paint expects to find 'Magic' tool plugins (".so" shared objects).
(e.g., "/usr/share/tuxpaint/plugins")
--localpluginprefix
Outputs the user directory where the installed copy of Tux Paint expects to find 'Magic' tool plugins (".so" shared objects).
(e.g., "/home/username/.tuxpaint/plugins")
--plugindocprefix
Outputs the directory where the installed copy of Tux Paint expects to find documentation for 'Magic' tool plugins (".html" and
".txt" files). Tux Paint's main documentation includes a link to this directory under the section on "Magic" tools.
--dataprefix
Outputs the system directory where the installed copy of Tux Paint keeps its global data files (e.g., "/usr/share/tuxpaint/"). This
is the same value that plugins installed system-wide will receive in the "data_directory" string within the "magic_api" structure
sent to the plugins' functions.
--localdataprefix
Outputs the user directory where the installed copy of Tux Paint expects plugins to install their local data files. (e.g.,
"/home/username/.tuxpaint/plugins/data"). This is the same value that plugins installed locally will receive in the "data_direc-
tory" string within the "magic_api" structure sent to the plugins' functions.
SYSTEM-WIDE SHELL EXAMPLES
$ gcc -shared `tp-magic-config --cflags` my_plugin.c -o my_plugin.so
# cp my_plugin.so `tp-magic-config --pluginprefix`
# cp my_plugin_icon.png `tp-magic-config --dataprefix`/images/magic
# cp my_plugin.html `tp-magic-config --plugindocrefix`/html
# cp my_plugin.txt `tp-magic-config --plugindocrefix`
LOCAL SHELL EXAMPLES
$ gcc -shared `tp-magic-config --cflags` my_plugin.c -o my_plugin.so
$ mkdir -p `tp-magic-config --localpluginprefix`
$ cp my_plugin.so `tp-magic-config --localpluginprefix`
$ mkdir -p `tp-magic-config --localdataprefix`/images/magic
$ cp my_plugin_icon.png `tp-magic-config --localdataprefix`/images/magic
SYSTEM-WIDE MAKEFILE EXAMPLE
MAGIC_CFLAGS=$(shell tp-magic-config --cflags)
MAGIC_PREFIX=$(shell tp-magic-config --pluginprefix)
MAGIC_DOC_PREFIX=$(shell tp-magic-config --plugindocprefix)
DATA_PREFIX=$(shell tp-magic-config --dataprefix)
all: my_plugin.so
my_plugin.so: my_plugin.c
install: install-so install-data install-docs
install-so:
mkdir -p $(MAGIC_PREFIX)
cp my_plugin.so $(MAGIC_PREFIX)/
chmod 644 $(MAGIC_PREFIX)/my_plugin.so
install-data:
mkdir -p $(DATA_PREFIX)
cp icons/my_plugin_icon.png $(DATA_PREFIX)/images/magic/
chmod 644 $(DATA_PREFIX)/images/magic/my_plugin_icon.png
install-docs:
mkdir -p $(MAGIC_DOC_PREFIX)
cp docs/my_plugin.html $(MAGIC_DOC_PREFIX)/html/
chmod 644 $(MAGIC_DOC_PREFIX)/html/my_plugin.html
cp docs/my_plugin.txt $(MAGIC_DOC_PREFIX)/
chmod 644 $(MAGIC_DOC_PREFIX)/my_plugin.txt
AUTHOR
Bill Kendrick. <bill@newbreedsoftware.com>
SEE ALSO tuxpaint(1),
And documentation within /usr/[local/]share/doc/tuxpaint/.
2007.08.07 07 August 2007 TP-MAGIC-CONFIG(1)