Use sed to append text to filenames if text not already present
I have some html with hrefs that contain local links to pdf filenames. These filenames should have standardised names, i.e. there should be a label prior to the ".pdf" filename suffix. There can be many of these links on a single line of text and some may already have the label. For example
I want the result to end up as
i.e. the text ' label' gets preprended to the filename before the .pdf.
It has to be done with sed. I have tried
but that will add an extra ' label' to the middle of the 3.
Any suggestions on how to achieve this?
Moderator's Comments:
Please use code tags next time for your code and data.
Last edited by zaxxon; 11-13-2012 at 04:21 AM..
Reason: code tags
Anyone know how to use SED to append a comma to the end of each line
example:
field1,field2,field3,field4
If i Cat /textfile ---- How can i append the end of /textfile with a comman? (8 Replies)
Suppose there are multiple files containing certain text "abc". How to print the name of all such files with a single command from unix prompt?
Thanks in advance (6 Replies)
Hi all,
I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output.
sed '$a\
hi...
' shell > shell1
But I face problem when using the same in script. It is throwing the error as,
sed: command garbled:... (4 Replies)
Hi All,
Please help me out in fllowing problem.
I have text file which contains the data in following format.
Contents of file.txt are
setregid02
Test that setregid() fails and sets the proper errno values when a
non-root user attemps to change the real or effective... (2 Replies)
Hi all
I tried this on an old version of sed on NCR Unix MP-RAS:
sed -e "s/$/nnn/" file1 >file2
This file (file1):
the cat sat on the mat.
the cat sat on the mat.
the cat sat on the mat.
becomes this (file2):
the cat sat on the mat.nnn
the cat sat on the mat.nnn
nnn
the... (3 Replies)
I have file .
cat hello.txt
Hello World
I would like to append a string "Today " so the output is
cat hello.txt
Hello World Today
I dont know which line number does the "Hello World" appears otherwise I could have used the Line number to search and append . (3 Replies)
Hi,
I have a File, which have multiple rows.
Like below
123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY
123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
I want to search a line which contains PB MO Approver and append... (2 Replies)
Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames?
AAAL_555A_ORANGE1_F190404.TXT
AAAL_555A_ORANGE2_F190404.TXT
AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)
Hi,
I have an issue modifying a file. Below is the content of the file.
File name - a.txt
SELECT LISTAGG(SCORE), LISTAGG(VB),
LISTAGG(SCORE*12 + 3),
LISTAGG(DOB)
from T_CONCAT ;
SELECT LISTAGG(SCORE),
LISTAGG(VB),
LISTAGG(SCORE*100 + 3),
from... (1 Reply)
Discussion started by: Mannu2525
1 Replies
LEARN ABOUT DEBIAN
image::exiftool::mxf
Image::ExifTool::MXF(3pm) User Contributed Perl Documentation Image::ExifTool::MXF(3pm)NAME
Image::ExifTool::MXF - Read MXF meta information
SYNOPSIS
This module is used by Image::ExifTool
DESCRIPTION
This module contains definitions required by Image::ExifTool to read meta information from MXF (Material Exchange Format) files.
AUTHOR
Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
REFERENCES
<http://sourceforge.net/projects/mxflib/>
<http://www.aafassociation.org/downloads/whitepapers/MXFPhysicalview.pdf>
<http://archive.nlm.nih.gov/pubs/pearson/MJ2_Metadata2005.pdf>
http://www.aafassociation.org/downloads/specifications/AMWA-AS-03-Delivery-Spec-1_0.pdf
<http://www.aafassociation.org/downloads/specifications/AMWA-AS-03-Delivery-Spec-1_0.pdf>
http://paul-sampson.ca/private/s385m.pdf <http://paul-sampson.ca/private/s385m.pdf>
<http://avwiki.nl/documents/eg41.pdf>
<http://avwiki.nl/documents/eg42.pdf>
http://www.amwa.tv/downloads/specifications/aafobjectspec-v1.1.pdf <http://www.amwa.tv/downloads/specifications/aafobjectspec-v1.1.pdf>
http://www.smpte-ra.org/mdd/RP210v12-publication-20100623.xls <http://www.smpte-ra.org/mdd/RP210v12-publication-20100623.xls>
http://rhea.tele.ucl.ac.be:8081/Plone/Members/egoray/thesaurus-dictionnaire-metadata/
<http://rhea.tele.ucl.ac.be:8081/Plone/Members/egoray/thesaurus-dictionnaire-metadata/>
http://www.mog-solutions.com/img_upload/PDF/XML%20Schema%20for%20MXF%20Metadata.pdf <http://www.mog-
solutions.com/img_upload/PDF/XML%20Schema%20for%20MXF%20Metadata.pdf>
<http://www.freemxf.org/freemxf_board/viewtopic.php?p=545&sid=00a5c17e07d828c1e93ecdbaed3076f7>
SEE ALSO
"MXF Tags" in Image::ExifTool::TagNames, Image::ExifTool(3pm)perl v5.12.4 2011-01-25 Image::ExifTool::MXF(3pm)