Sponsored Content
Top Forums Programming Perl: Question about stripping tags Post 302621301 by balajesuri on Tuesday 10th of April 2012 07:45:42 AM
Old 04-10-2012
Code:
[user@cygwin ~]$ cat input
<note>
    <to>John</to>
    <from>Jack</from>
    <heading>Hello</heading>
    <body>Howdy</body>
</note>
[user@cygwin ~]$ perl -pe 's/<.+?>//g' input

    John
    Jack
    Hello
    Howdy

[user@cygwin ~]$

If you want more accurate solutions, please post a sample input file and desired output.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

stripping last lien off a file

Hi, how can i strip the last line off my file using shell script? Thanks and Regards Vivek.S (3 Replies)
Discussion started by: vivekshankar
3 Replies

2. UNIX for Dummies Questions & Answers

stripping server name from path

can anyone help me with stripping an absolute filepath? I did a search on this topic but didnt find anything but maybe I didn't look hard. Anyway, would really appreciate it if anyone could help me. I am a new unix user so this might be a simple issue but I am stuck, don't really understand the use... (4 Replies)
Discussion started by: Ecclesiastes
4 Replies

3. Shell Programming and Scripting

stripping out certain charecters

we are ftping zipped up files from the development server to the production server daily.The files are in this format filename.dat.20061231.12131.gz I have to unzip the file (i can do that with gunzip) and then strip out the timestamp after the .dat extension. I can do something like this ... (4 Replies)
Discussion started by: mervin2006
4 Replies

4. UNIX for Dummies Questions & Answers

Stripping all content but an integer

Hello! I have content in a log file that consists of a lot of spaces before and after a 3 digit integer which I need to strip out before I can use the file. The number of digits can change. When I had my logic in a 'for' loop and could output into another file, it was fine. but it turns out... (10 Replies)
Discussion started by: tekster757
10 Replies

5. Shell Programming and Scripting

stripping white space...

Hi All; Having a problem with a file.. the file contains the following data... (a snapshot) 1331F9E9DB7C2BB80EAEDE3A8F043B94,AL7 1DZ,M,50 186FDF93E1303DBA217279EC3671EA91,NG5 1JU,M,24 3783FFAF602015056A8CD21104B1AAAF,CH42 4NQ,M,17 It has 3 columns sepreated by a , the second column... (7 Replies)
Discussion started by: Zak
7 Replies

6. Shell Programming and Scripting

Stripping out extension in file name

This command gives me just the filename without any extension: evrvar =`echo filename.tar | sed 's/\.*$//'` I am trying to make a change to this command... to make it work for... filename.tar.gz to get just the filename.... currently the command gives me filename.tar by removing only gz... I... (9 Replies)
Discussion started by: devs
9 Replies

7. Shell Programming and Scripting

stripping a variable down

I have a variable that has an absolute path for a file on my computer. This dynamically changes. Is there a way I can assign two new variables from that one? variable: /Users/keith/Desktop/test/file.mov 1) filename - no path or extention ....so just....file 2) path no filename or... (3 Replies)
Discussion started by: mainegate
3 Replies

8. UNIX for Dummies Questions & Answers

Stripping down binaries

Hello, I am the CEO of Grand Tech Corporation. We are launching Linux NT and forgive me, but I do not know how to strip binaries down in Mandriva Linux. Can someone tell me a way to?:b: (2 Replies)
Discussion started by: Linux NT
2 Replies

9. Solaris

Diffrence between stripping and mirroring

Hi All, What is the difference between stripping and mirroring? Thanks, Rafi. (3 Replies)
Discussion started by: rafidba.alvi
3 Replies

10. Shell Programming and Scripting

Stripping ret of the lines in a file (sed question)

Hi all, I didn't use SED for 20 years and was never an expert. So my current knowledge is about zero. Please be patient with me. I'm neither a native speaker. I have a huge dictionary file and want the rest of the lines stripped. Everything after (and including) the "/" should be stripped. I... (2 Replies)
Discussion started by: Hinnerk2005
2 Replies
TIFFWriteRawStrip(3tiff)				 Introduction to Library Functions				  TIFFWriteRawStrip(3tiff)

NAME
TIFFWriteRawStrip - write a strip of raw data to an open TIFF file SYNOPSIS
#include <tiffio.h> tsize_t TIFFWriteRawStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) DESCRIPTION
Append size bytes of raw data to the specified strip. EXTENDED DESCRIPTION
The strip number must be valid according to the current settings of the ImageLength and RowsPerStrip tags. An image may be dynamically grown by increasing the value of ImageLength prior to each call to TIFFWriteRawStrip. Diagnostics All error messages are directed to the TIFFError(3tiff) routine. %s: File not open for wrThenfile was opened for reading, not writing. Can not write scanlines Theaimagedismassumed to be organized in tiles because the TileWidth and TileLength tags have been set with TIFFSet- Field(3tiff). %s: Must set "ImageWidthTheeimagewwidthghastnot been set before the first write. See TIFFSetField(3tiff) for information on how to do this. %s: Must set "PlanarConfTheraorganization woftidataahas not been defined before the first write. See TIFFSetField(3tiff) for information on how to do this. %s: No space for strip aThere"was not enough space for the arrays that hold strip offsets and byte counts. %s: Strip %d out of rangThemspecified strip is not a valid strip according to the currently specified image dimensions. RETURN VALUES
-1 is returned if an error was encountered. Otherwise, the value of size is returned. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWTiff | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
libtiff(3), TIFFOpen(3tiff), TIFFWriteEncodedStrip(3tiff), TIFFWriteScanline(3tiff) NOTES
This man page was originally written by Sam Leffler. Updated by Breda McColgan, Sun Microsystems Inc., 2004. SunOS 5.10 05 Apr 2004 TIFFWriteRawStrip(3tiff)
All times are GMT -4. The time now is 03:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy