Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Including Hash / in sed command filter Post 303030649 by Xtreme on Wednesday 13th of February 2019 07:56:52 AM
Old 02-13-2019
Hello Bakunin,

Sorry it was my bad. The command didn't work first due to some extra space needed which I added and now it is working. So your solution was perfect for my problem. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed or other tool to manipulate data, including email addresses

I have a list of names and email addresses, like this. The <tab> markers are actually tabs. joe.blow <tab> joe.blow@wherever.com tom.t.hall <tab> tom.t.hall@wherever.com john.r.smith <tab> john.r.smith@wherever.com sally.jones <tab> sally.jones@state.or.us I want to parse the data so that... (3 Replies)
Discussion started by: manouche
3 Replies

2. Shell Programming and Scripting

How to use sed to remove html tags including text between them

How to use sed to remove html tags including text between them? Example: User <b> rolvak </b> is stupid. It does not using <b>OOP</b>! and should output: User is stupid. It does not using ! Thank you.. (2 Replies)
Discussion started by: alphagon
2 Replies

3. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

4. Shell Programming and Scripting

How to filter only comments while reading a file including line break characters.

How do I filter only comments and still keep Line breaks at the end of the line!? This is one of the common tasks we all do,, How can we do this in a right way..!? I try to ignore empty lines and commented lines using following approach. test.sh # \040 --> SPACE character octal... (17 Replies)
Discussion started by: kchinnam
17 Replies

5. Shell Programming and Scripting

sed: remove characters between and including 2 strings

I have the following line: 4/23/2010 0:00:38.000: Copying $$3MSYDDC02$I would like to use sed (or similiar) to remove everthing between and including $ that appears in the line so it ends up like this. 4/23/2010 0:00:38.000: Copying 3MSYDDC02I have been trying these but i'm really just... (5 Replies)
Discussion started by: jelloir
5 Replies

6. Shell Programming and Scripting

Filter date and time form a file using sed command

I want to filter out the date and time from this line in a file. How to do this using sed command. on Tue Apr 19 00:48:29 2011 (12 Replies)
Discussion started by: vineet.dhingra
12 Replies

7. Shell Programming and Scripting

Problem with filter data using sed command

Hi, I am using the following command(sed) to get the key/value pair from the string String="{ "test":"test message", "testmessage":"subscription is active, charge successfully} " }" status=$( echo $String | sed -e 's/^.*\("testmessage":*\).*$/\1/') echo $status i am getting this... (2 Replies)
Discussion started by: nanthagopal
2 Replies

8. Shell Programming and Scripting

sed - remove begin of line up to the third and including occurence of character

hello. How to remove all characters in a line from first character ( a $ ) until and including the third occurrence of that character ( $ ). Any help is welcome. (10 Replies)
Discussion started by: jcdole
10 Replies

9. Shell Programming and Scripting

Remove bracket including text inside with sed

Hello, I could not remove brackets with text contents myfile: Please remove the bracket with text I wish to remove: I tried: sed 's/\//' myfile It gives: Please remove the bracket with text A1 I expect: Please remove the bracket with text Many thanks Boris (2 Replies)
Discussion started by: baris35
2 Replies

10. Shell Programming and Scripting

Issue with user input including * (glob) and sed

Hello All, I have created a script that searches for different things and "sanitizes" the findings from files. Currently the user is required to put in a hostname (server.serverfarm.abc) one at a time to replace. I would like the user be able to use *.*.abc in grep and then pipe into sed to... (1 Reply)
Discussion started by: jvezinat
1 Replies
Locale::Po4a::Sgml(3)					User Contributed Perl Documentation				     Locale::Po4a::Sgml(3)

NAME
Locale::Po4a::Sgml - convert SGML documents from/to PO files DESCRIPTION
The po4a (PO for anything) project goal is to ease translations (and more interestingly, the maintenance of translations) using gettext tools on areas where they were not expected like documentation. Locale::Po4a::Sgml is a module to help the translation of documentation in the SGML format into other [human] languages. This module uses nsgmls to parse the SGML files. Make sure it is installed. Also make sure that the DTD of the SGML files are installed in the system. OPTIONS ACCEPTED BY THIS MODULE
debug Space separated list of keywords indicating which part you want to debug. Possible values are: tag, generic, entities and refs. verbose Give more information about what's going on. translate Space separated list of extra tags (beside the DTD provided ones) whose content should form an extra msgid. section Space separated list of extra tags (beside the DTD provided ones) containing other tags, some of them being of category translate. indent Space separated list of tags which increase the indentation level. verbatim The layout within those tags should not be changed. The paragraph won't get wrapped, and no extra indentation space or new line will be added for cosmetic purpose. empty Tags not needing to be closed. ignore Tags ignored and considered as plain char data by po4a. That is to say that they can be part of an msgid. For example, <b> is a good candidate for this category since putting it in the translate section would create msgids not being whole sentences, which is bad. attributes A space separated list of attributes that need to be translated. You can specify the attributes by their name (for example, "lang"), but you can also prefix it with a tag hierarchy, to specify that this attribute will only be translated when it is into the specified tag. For example: <bbb><aaa>lang specifies that the lang attribute will only be translated if it is in an <aaa> tag, which is in a <bbb> tag. The tag names are actually regular expressions so you can also write things like <aaa|bbbb>lang to only translate lang attributes that are in an <aaa> or a <bbb> tag. qualify A space separated list of attributes for which the translation must be qualified by the attribute name. Note that this setting automatically adds the given attribute into the 'attributes' list too. force Proceed even if the DTD is unknown or if nsgmls finds errors in the input file. include-all By default, msgids containing only one entity (like '&version;') are skipped for the translator comfort. Activating this option prevents this optimisation. It can be useful if the document contains a construction like "<title>&Aacute;</title>", even if I doubt such things to ever happen... ignore-inclusion Space separated list of entities that won't be inlined. Use this option with caution: it may cause nsgmls (used internally) to add tags and render the output document invalid. STATUS OF THIS MODULE
The result is perfect. I.e., the generated documents are exactly the same. But there are still some problems: o The error output of nsgmls is redirected to /dev/null, which is clearly bad. I don't know how to avoid that. The problem is that I have to "protect" the conditional inclusions (i.e. the "<! [ %foo [" and "]]>" stuff) from nsgmls. Otherwise nsgmls eats them, and I don't know how to restore them in the final document. To prevent that, I rewrite them to "{PO4A-beg-foo}" and "{PO4A-end}". The problem with this is that the "{PO4A-end}" and such I add are valid in the document (not in a <p> tag or so). Everything works well with nsgmls's output redirected that way, but it will prevent us from detecting that the document is badly formatted. o It does work only with the DebianDoc and DocBook DTD. Adding support for a new DTD should be very easy. The mechanism is the same for every DTD, you just have to give a list of the existing tags and some of their characteristics. I agree, this needs some more documentation, but it is still considered as beta, and I hate to document stuff which may/will change. o Warning, support for DTDs is quite experimental. I did not read any reference manual to find the definition of every tag. I did add tag definition to the module 'till it works for some documents I found on the net. If your document use more tags than mine, it won't work. But as I said above, fixing that should be quite easy. I did test DocBook against the SAG (System Administrator Guide) only, but this document is quite big, and should use most of the DocBook specificities. For DebianDoc, I tested some of the manuals from the DDP, but not all yet. o In case of file inclusion, string reference of messages in PO files (i.e. lines like "#: en/titletoc.sgml:9460") will be wrong. This is because I preprocess the file to protect the conditional inclusion (i.e. the "<! [ %foo [" and "]]>" stuff) and some entities (like &version;) from nsgmls because I want them verbatim to the generated document. For that, I make a temp copy of the input file and do all the changes I want to this before passing it to nsgmls for parsing. So that it works, I replace the entities asking for a file inclusion by the content of the given file (so that I can protect what needs to be in a subfile also). But nothing is done so far to correct the references (i.e., filename and line number) afterward. I'm not sure what the best thing to do is. AUTHORS
This module is an adapted version of sgmlspl (SGML postprocessor for the SGMLS and NSGMLS parsers) which was: Copyright (c) 1995 by David Megginson <dmeggins@aix1.uottawa.ca> The adaptation for po4a was done by: Denis Barbier <barbier@linuxfr.org> Martin Quinson (mquinson#debian.org) COPYRIGHT AND LICENSE
Copyright (c) 1995 by David Megginson <dmeggins@aix1.uottawa.ca> Copyright 2002, 2003, 2004, 2005 by SPI, inc. This program is free software; you may redistribute it and/or modify it under the terms of GPL (see the COPYING file). perl v5.16.3 2014-06-10 Locale::Po4a::Sgml(3)
All times are GMT -4. The time now is 02:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy