There is no quick one or two liners native to perl to do this. If you want to use the perl program you have already written I would insert the sed statement Scrutinizer posted after the close file line in your foreach structure followed by a copy statement using the system function.
Hello, i need some help with a perl script.
i need to add the lines:
#ifdef LOGALLOC
#include "logalloc.h"
#endif // LOGALLOC
To all c and h files in a project with subdirectories.
Logalloc is a tool to log all *alloc and free's in a text file, it defines the *alloc funtions new.... (2 Replies)
Hi
i have the below lines from a file
7538
PRGRP450800PERSONAL SOAP AND BATH ADDITIV 7036
PRGRP450800PERSONAL SOAP AND BATH ADDITIV 7036
PRGRP450800PERSONAL SOAP AND BATH ADDITIV 7036... (3 Replies)
Hey everyone, I have a question about comparing two files. I have two lists of files. The first list, todo.csv, lists a series of compounds my supervisor wants me to perform calculations on. The second list, done.csv, lists a series of compounds that I have already performed calculations on.... (2 Replies)
In my bash script I want to echo lines in a file and ensure no blank lines are echoed:for i in $(cat txt)
do
echo $i | sed 's/|/ /g;s/ SEARCHTERM$//g;s/ /\r\n/g;s/^$/d'
done
Keep in mind this is a fragment so ignore the fact that the for loop is not closed. When I add the "s/^$/d' per... (12 Replies)
Hi All,
How do i remove continuos blank lines from a file.
I have a file with data:
abc;
def;
ghi;
jkl;
mno;
pqr;
In the above file, there are two blank lines. I want to remove, one out of them.
My output should look like: (2 Replies)
Hi,
my input file is like this I want to remove the blank line.
"/home/rit/sandbox/garuda/data/test/woman/T_RITK_F0008_ML_100080039.lab"
r
a
N
e
l
a
k
sh
a
m
.
"/home/rit/sandbox/garuda/data/test/woman/T_RITK_F0008_ML_100070453.lab"
a
v
a
s (4 Replies)
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Hello Gurus,
I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file.
1|ABC DEF|100|10
2|PQ
RS
T|200|20
3| UVWXYZ|300|30
4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies
LEARN ABOUT OPENSOLARIS
xmllint
xmllint(1) General Commands Manual xmllint(1)NAME
xmllint - command line XML tool
SYNOPSIS
xmllint [--version | --debug | --shell | --debugent | --copy | --recover | --noent | --noout | --htmlout | --nowrap | --valid | --postvalid
| --dtdvalid URL | --timing | --repeat | --insert | --compress | --sgml | --html | --push | --memory | --nowarning | --noblanks | --for-
mat | --testIO | --encode encoding | --catalogs | --nocatalogs | --auto | --xinclude | --loaddtd | --dtdattr | --dropdtd] [xmlfile]
INTRODUCTION
The xmllint program parses one or more XML files, specified on the command line as xmlfile. It prints various types of output, depending
upon the options selected. It is useful for detecting errors both in XML code and in the XML parser itself.
It is included in libxml2.
OPTIONS --version
Display the version of libxml2 used.
--debug
Parse a file and output an annotated tree of the in-memory version of the document.
--shell
Run a navigating shell.
--debugent
Debug the entities defined in the document.
--copy Test the internal copy implementation.
--recover
Output any parsable portions of an invalid document.
--noent
Substitute entity values for entity references. By default, xmllint leaves entity references in place.
--noout
Suppress output. By default, xmllint outputs the result tree.
--htmlout
Output results as an HTML file. This causes xmllint to output the necessary HTML tags surrounding the result tree output so the
results can be displayed in a browser.
--nowrap
Do not output HTML doc wrapper.
--valid
Determine if the document is a valid instance of the included Document Type Definition (DTD). A DTD to be validated against also can
be specified at the command line using the --dtdvalid option. By default, xmllint also checks to determine if the document is well-
formed.
--postvalid
Validate after parsing is completed.
--dtdvalid URL
Use the DTD specified by URL for validation.
--timing
Output information about the time it takes xmllint to perform the various steps.
--repeat
Repeat 100 times, for timing or profiling.
--insert
Test for valid insertions.
--compress
Turn on gzip compression of output.
--sgml Use the DocBook SGML parser. This allows documents written in SGML DocBook to be converted into an in-memory tree and treated as if
they were written in XML.
--html Use the HTML parser.
--push Use the push mode of the parser.
--memory
Parse from memory.
--nowarning
Do not emit warnings from the parser and/or validator.
--noblanks
Drop ignorable blank spaces.
--format
Reformat and reindent the output.
--testIO
Test user input/output support.
--encode encoding
Output in the given encoding.
--catalogs
Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default.
--nocatalogs
Do not use any catalogs.
--auto Generate a small document for testing purposes.
--xinclude
Do XInclude processing.
--loaddtd
Fetch external DTD.
--dtdattr
Fetch external DTD and populate the tree with inherited attributes.
--dropdtd
Remove DTD from output.
AUTHORS
John Fleck <jfleck@inkstain.net>, Ziying Sherwin <sherwin@nlm.nih.gov>, Heiko Rupp <hwr@pilhuhn.de> This is release 0.2 of the xmllint Man-
ual.
NOTES
Source for libxml is available on http://opensolaris.org. Documentation for libxml is available on-line at http://www.xmlsoft.org/
2001 Nov 26 xmllint(1)