Sponsored Content
Top Forums Shell Programming and Scripting Help with shell script and sed! Post 302447928 by o0110o on Tuesday 24th of August 2010 05:05:08 PM
Old 08-24-2010
Quote:
Originally Posted by bartus11
Post exact data (or sample of it) that is in FileA, FileB, and corresponding output file, that you want to produce.
File A
Code:
http://lh6.ggpht.com/_0ga0wb33PoQ/S2ulPfVJBTI/AAAAAAAAAYs/1wxZhiPW1mw/BM09_Starlight_-10.jpg
http://lh3.ggpht.com/_WpT8ajiz98w/R7aUf5YVUiI/AAAAAAAAAHA/00XJnAPH7TM/DSC02803.JPG
http://lh4.ggpht.com/_jgRMak8S5Ec/R5M5Zp8WFsI/AAAAAAAACWY/wrYFlk3e72c/Rubix%20Pyramid.JPG
http://lh3.ggpht.com/_WpT8ajiz98w/R7aT35YVUHI/AAAAAAAAADk/opr7BOANg2w/DSC02776.JPG
http://lh6.ggpht.com/_dFjcay6XJ8I/SM8PGL2ytcI/AAAAAAAAFmA/jKMF6wiNyaU/IMG_1367.JPG
http://lh3.ggpht.com/_AMLQDMZjxvk/RvQc2eZhxZI/AAAAAAAABt0/QmXjo-opZqk/DSCF1238.JPG
http://lh5.ggpht.com/_Ehm252Yypl4/S1uM4m374JI/AAAAAAAAKyk/dzsIhkApavc/IMG_5049.JPG
http://lh6.ggpht.com/_dfc1-DMKhn8/SQQTyuwfXLI/AAAAAAAABJs/E5BF5Ype_JU/Rubix%20Cubes%20%26%20Dogs%20010.jpg
http://lh5.ggpht.com/_dfc1-DMKhn8/SQQPXCS4sNI/AAAAAAAABIU/s7c0-tU18jA/Rubix%20Cubes%20%26%20Dogs%20048.jpg
http://lh4.ggpht.com/_tBkR4qZOXa0/Sb8aLUpr-vI/AAAAAAAAAQ8/55tir3tFWQQ/DSC_2723.JPG

File B
Code:
BM09_Starlight_-10.jpg
DSC02803.JPG
Rubix%20Pyramid.JPG
DSC02776.JPG
IMG_1367.JPG
DSCF1238.JPG
IMG_5049.JPG
Rubix%20Cubes%20%26%20Dogs%20010.jpg
Rubix%20Cubes%20%26%20Dogs%20048.jpg
DSC_2723.JPG

Output File (Desired Result)
Code:
http://lh6.ggpht.com/_0ga0wb33PoQ/S2ulPfVJBTI/AAAAAAAAAYs/1wxZhiPW1mw/
http://lh3.ggpht.com/_WpT8ajiz98w/R7aUf5YVUiI/AAAAAAAAAHA/00XJnAPH7TM/
http://lh4.ggpht.com/_jgRMak8S5Ec/R5M5Zp8WFsI/AAAAAAAACWY/wrYFlk3e72c/
http://lh3.ggpht.com/_WpT8ajiz98w/R7aT35YVUHI/AAAAAAAAADk/opr7BOANg2w/
http://lh6.ggpht.com/_dFjcay6XJ8I/SM8PGL2ytcI/AAAAAAAAFmA/jKMF6wiNyaU/
http://lh3.ggpht.com/_AMLQDMZjxvk/RvQc2eZhxZI/AAAAAAAABt0/QmXjo-opZqk/
http://lh5.ggpht.com/_Ehm252Yypl4/S1uM4m374JI/AAAAAAAAKyk/dzsIhkApavc/
http://lh6.ggpht.com/_dfc1-DMKhn8/SQQTyuwfXLI/AAAAAAAABJs/E5BF5Ype_JU/
http://lh5.ggpht.com/_dfc1-DMKhn8/SQQPXCS4sNI/AAAAAAAABIU/s7c0-tU18jA/
http://lh4.ggpht.com/_tBkR4qZOXa0/Sb8aLUpr-vI/AAAAAAAAAQ8/55tir3tFWQQ/

These links aren't static, they change everyday Smilie

Last edited by o0110o; 08-24-2010 at 06:30 PM.. Reason: Shortened up the examples :)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed command in shell script

I have a current code working(named subst1) having a user be able to type this line to substitute words using the sed command: subst1 old-pattern new-pattern filename Here is my shell script: #!/bin/bash # subst1 ARGS=3 E_BADARGS=65 if then echo "Usage: `basename $0`... (1 Reply)
Discussion started by: Todd88
1 Replies

2. Shell Programming and Scripting

shell script by sed

Hey everybody I need some help on how to order the data in file such as a file have first name last name and city and i would like to order them to in the same order by using sed thanks alot for your time (6 Replies)
Discussion started by: halola85
6 Replies

3. UNIX for Dummies Questions & Answers

shell script - sed

Hi i have a problem how to put som lines on top or in the bottom of the text with sed. problem is that i am reading from stdin and when i have som lines starting with ++, i have to put some characters on the top of the lines starting with that ++ example of input oooo ++abcd ++befg... (1 Reply)
Discussion started by: Dun
1 Replies

4. Shell Programming and Scripting

using sed in shell script

Hi all, I have files with the following names; afgcxa.pem4jan.rain.nc afgcxa.pem4feb.rain.nc afgcxa.pem4mar.rain.nc afgcxa.pem4apr.rain.nc I want to rename them to afgcxa.pem4-01.jan.rain.nc afgcxa.pem4-02.feb.rain.nc afgcxa.pem4-03.mar.rain.nc ... (5 Replies)
Discussion started by: Muhammad Rahiz
5 Replies

5. UNIX for Dummies Questions & Answers

Problems in shell script if sed is used

Hi All, Below is the script which i have written in cygwin: #!/usr/bin/sh fname=$1 cat $fname | sed 's/ //g' > fname1 for i in `cat $fname1` do echo $i > file1 #param1 is script name param1=`awk -F , '{print $1}' file1` param1="$param1.sql" #param2 is BL param2=`awk -F , '{print... (5 Replies)
Discussion started by: janardhanamk
5 Replies

6. Shell Programming and Scripting

using sed in shell script

Hi, i want to replace sub text which is in the middle of long text. let me be more clear with an example. Here is the actual text in the xml file <module-option name="principalDNSuffix">,cn=Users,dc=X,dc=Y</module-option> Now, in the above text, i want to replace all the content lying... (3 Replies)
Discussion started by: sunrexstar
3 Replies

7. Shell Programming and Scripting

SED shell script

Generate a ddl file, we have a flat file which contains many commands like REM, CREATE table, TRuncate etc This script should copy only create table statements to the ddl file. Create stmts can be in a single or multiple lines. ex:- INPUT FILE create table tbl1 (fld1,... (5 Replies)
Discussion started by: learninfo
5 Replies

8. Programming

Shell script using sed or awk

Hi, I want to read a file from the command line and remove all the spaces, tabs in it, replacing it with comma(,), and write it to a new file. can you help me out with this scenario. (1 Reply)
Discussion started by: sudhanshu12788
1 Replies

9. Homework & Coursework Questions

Asst: Shell Script to sed

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Generalize your sub2 script, producing a new script sub3 that will apply a substitution to any number of files... (16 Replies)
Discussion started by: raymondbn
16 Replies

10. Shell Programming and Scripting

Need help on shell script (sed)

Hi Guys, I have a xml file as below where I need to find the particular XML tag(<dpath>) and delete the content of it. <?xml version="1.0" encoding="UTF-8"?> <title>XML</title><head>Ram</head><ControlCenter><doStatus>1</doStatus></ControlCenter><exitlabel>Gzip... (7 Replies)
Discussion started by: Vinoth Kumar G
7 Replies
GD_INFO(3)								 1								GD_INFO(3)

gd_info - Retrieve information about the currently installed GD library

SYNOPSIS
array gd_info (void ) DESCRIPTION
Gets information about the version and capabilities of the installed GD library. RETURN VALUES
Returns an associative array. Elements of array returned by gd_info(3) +-------------------+---------------------------------------------------+ | Attribute | | | | | | | Meaning | | | | +-------------------+---------------------------------------------------+ | GD Version | | | | | | | | | | string value describing the installed libgd ver- | | | sion. | | | | | FreeType Support | | | | | | | | | | boolean value. TRUE if FreeType Support is | | | installed. | | | | | FreeType Linkage | | | | | | | | | | string value describing the way in which FreeType | | | was linked. Expected values are: 'with freetype', | | | 'with TTF library', and 'with unknown library'. | | | This element will only be defined if FreeType | | | Support evaluated to TRUE. | | | | | T1Lib Support | | | | | | | | | | boolean value. TRUE if T1Lib support is | | | included. | | | | | GIF Read Support | | | | | | | | | | boolean value. TRUE if support for reading GIF | | | images is included. | | | | |GIF Create Support | | | | | | | | | | boolean value. TRUE if support for creating GIF | | | images is included. | | | | | JPEG Support | | | | | | | | | | boolean value. TRUE if JPEG support is included. | | | | | PNG Support | | | | | | | | | | boolean value. TRUE if PNG support is included. | | | | | WBMP Support | | | | | | | | | | boolean value. TRUE if WBMP support is included. | | | | | XBM Support | | | | | | | | | | boolean value. TRUE if XBM support is included. | | | | | WebP Support | | | | | | | | | | boolean value. TRUE if WebP support is included. | | | | +-------------------+---------------------------------------------------+ Note Previous to PHP 5.3.0, the JPEG Support attribute was named JPG Support. EXAMPLES
Example #1 Using gd_info(3) <?php var_dump(gd_info()); ?> The above example will output something similar to: array(9) { ["GD Version"]=> string(24) "bundled (2.0 compatible)" ["FreeType Support"]=> bool(false) ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(false) ["JPEG Support"]=> bool(false) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(false) } CHANGELOG
+--------+------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+------------------------------------------------+ | 5.5.0 | | | | | | | | | | WebP Support added. | | | | | 5.3.0 | | | | | | | | | | JPG Support attribute renamed to JPEG Support. | | | | +--------+------------------------------------------------+ SEE ALSO
imagepng(3), imagejpeg(3), imagegif(3), imagewbmp(3), imagetypes(3). PHP Documentation Group GD_INFO(3)
All times are GMT -4. The time now is 07:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy