Sponsored Content
Top Forums Shell Programming and Scripting how to cut the last field without using awk Post 302606804 by anandgodse on Monday 12th of March 2012 10:01:24 PM
Old 03-12-2012
Bug how to cut the last field without using awk

i have file as with the below content

aaa.bbb.cc.dd
aaa.fff.bb
yyyyy.rrrrr.ggggg.iii
wwww.w.r.ty


i want the o/p as below

dd
bb
iii
ty

but i dont want to use awk. is there any other way to do this ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to use cut to get the last field of a string?

If I am not sure of how many fields a string has, say STR=/homt/root/dir1/dir2/../dirn how to use "cut -d/ -f" to get dirn ? (3 Replies)
Discussion started by: meili100
3 Replies

2. Shell Programming and Scripting

Cut last Field

Guys, I have a line like this: 109;201;1099010 and as you see that first field 109 and the last field starts with 109. I need to cut the rest in the last field after 109 which is 9010 How to do it? (2 Replies)
Discussion started by: sfaqih
2 Replies

3. Shell Programming and Scripting

How do I cut out this field?

Hello, In a shell script I am writing I execute this command: uniq -c names1.tmp > names2.tmp In names2.tmp I get these results: 4 user 2 username 1 users 1 veriano 1 victoria I need to isolate the names in this file and put it in another file. However it seems that the number... (7 Replies)
Discussion started by: mojoman
7 Replies

4. Shell Programming and Scripting

Cut the last field

Hello guys. Is there any way I can cut the last field using "cut" ??? (without putting it into a while...) Thanks. 435 Gavea. (9 Replies)
Discussion started by: 435 Gavea
9 Replies

5. UNIX for Advanced & Expert Users

Printing Field with Delimiter in AWK/cut

Hello, I had posted earlier about printing fields using AWK, but now I have a slightly different problem. I have text files in the format: 1*2,3,4,5 and wish to print the first, third, and fifth fields, including the asterisk and commas. In other words, after filtering it should look... (1 Reply)
Discussion started by: Jahn
1 Replies

6. Shell Programming and Scripting

cut a field, but with reverse order

Hi Everyone, I have one a.txt: a b 001 c b b 002 c c c, not 002 c The output should be 001 002 002 If i use cut -f 3 -d' ', this does not work on the 3rd line, so i thought is any way to cut the field counting from the end? or any perl thing can do this?:confused: ... (3 Replies)
Discussion started by: jimmy_y
3 Replies

7. Shell Programming and Scripting

awk,cut fields by change field format

Hi Everyone, # cat 1.txt 1321631,77770132976455,19,20091001011859,20091001011907 1321631,77770132976455,19,20091001011859,20091001011907 1321631,77770132976455,19,20091001011859,20091001011907 # cat 1.txt | awk -F, '{OFS=",";print $1,$3,$4,$5}' 1321631,19,20091001011859,20091001011907... (7 Replies)
Discussion started by: jimmy_y
7 Replies

8. Shell Programming and Scripting

how to cut a particular field

hi all i am need to cut the name of the file which i am entering in the comand line. say abc.txt is the name of the file i need to cut only the "abc" part. when i try doing this(using cut -f1) i am getting the data that s present inside the file and the file name. pls help.... (3 Replies)
Discussion started by: din_annauniv
3 Replies

9. Shell Programming and Scripting

Cut third field of every third line

Hello, I have got a log file and would need to write a script to cut the every first and second fields of every third line. Job Name : dummytextd_v1 Status : KILLED TIMEDOUT 2011-05-01 05:33 Job Name : dummyttx_v1 Status : KILLED TIMEDOUT 2011-05-03 02:33 Job Name :... (4 Replies)
Discussion started by: Kochappa
4 Replies

10. UNIX for Beginners Questions & Answers

Cut the first field and the 2 last field

Hello, I would like to cut the first field and the 2 last fields from the string.Please help. Here is the example of the string.DL_FUND_FULL_20190605.txt DL_FUND_HIS_DEL_20190605.txt DL_FUND_HIS_TMP_DEL20190605.txt Please noted that DL_ --> Every files have the prefix like this.... (3 Replies)
Discussion started by: palita2601
3 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.14.2 2012-05-17 Locale::Po4a::Sgml(3)
All times are GMT -4. The time now is 10:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy