Sponsored Content
Top Forums Shell Programming and Scripting cut a field, but with reverse order Post 302365411 by jimmy_y on Tuesday 27th of October 2009 01:54:47 AM
Old 10-27-2009
Hammer & Screwdriver

Quote:
Originally Posted by jimmy_y
Hi Everyone,

I have one a.txt:
Code:
a b 001 c
b b 002 c
c c, not 002 c

The output should be
Code:
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?Smilie

Thanks

I found the solution already, use "reverse split" Smilie
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using sed and regex to reverse order???

so i have been trying to learn how to manipulate text on my own and have gotten stumped... let's say i have a text file that says (highly simplified): people ordinary How would swap the order of the words.. I know i need to use sed and some kind of back reference but cannot make it... (2 Replies)
Discussion started by: urtherhoda
2 Replies

2. Shell Programming and Scripting

sort a file in reverse order

I a file with log entries... I want to sort it so that the last line in the file is first and the first line is last.. eg. Sample file 1 h a f 8 6 After sort should look like 6 8 f a h 1 (11 Replies)
Discussion started by: frustrated1
11 Replies

3. UNIX for Dummies Questions & Answers

sort -reverse order

I need to sort the particular column only in reverse order how i can give it.. if i give the -r option the whole file is getting sorted in reverse order. 1st 2nd col 3rd C col 4th col 5th col ------------------------------------------- C... (7 Replies)
Discussion started by: sivakumar.rj
7 Replies

4. Shell Programming and Scripting

How to get fields in reverse order?

i am having lines like below seperated by "|" (pipe) abc|xyz 123|567 i have to get the above in reverse order xyz|abc 567|123 Pls help (5 Replies)
Discussion started by: suryanarayana
5 Replies

5. UNIX for Dummies Questions & Answers

How to print arguments in reverse order?

Hey all, How do I make a script print its arguments in reverse order? Thanks (5 Replies)
Discussion started by: unclepickle1
5 Replies

6. UNIX for Dummies Questions & Answers

printing fields in reverse order

command/script(apart from awk) to print the fields in reverse order that is last field has to come first and so on and first field has to go last Input store-id date sale ............. ............. ... (3 Replies)
Discussion started by: tsurendra
3 Replies

7. Shell Programming and Scripting

print in reverse order

Hi, I want to print the item in reverse order such that the output would look like 00 50 50 23 40 22 02 96 Below is the input: 00 05 05 32 04 22 20 69 Video tutorial on how to use code tags in The UNIX and Linux Forums. (5 Replies)
Discussion started by: reignangel2003
5 Replies

8. Shell Programming and Scripting

Delete records in reverse order

Hi all, i have dynamic file 'xyz.txt', records always look likes below format ... 0000021 RET 31-MAR-1984 FAP 0000021 DTA 14-JAN-2003 CNV 0000021 DTA 25-MAR-2012 DTA 0000021 DTA 26-MAR-2012 DTA ################################################# 0000021 DTA ... (4 Replies)
Discussion started by: krupasindhu18
4 Replies

9. UNIX for Beginners Questions & Answers

Issues with sorting in reverse order

I have a unix script that outputs a summary file to the mac desktop. The file is called summary.txt I am trying to configure such so that the summary.txt file lists the content contained within such in reverse sort order. I have used sort -r but it does not seem to work. I would be... (8 Replies)
Discussion started by: Braveheart
8 Replies
DAHDI_HARDWARE(8)					User Contributed Perl Documentation					 DAHDI_HARDWARE(8)

NAME
dahdi_hardware - Shows Dahdi hardware devices. SYNOPSIS
dahdi_hardware [-v][-x] OPTIONS
-v Verbose ouput - show spans used by each device etc. Currently only implemented for the Xorcom Astribank. -x Show disconnected Astribank unit, if any. DESCRIPTION
Show all dahdi hardware devices. Devices are recognized according to lists of PCI and USB IDs in Dahdi::Hardware::PCI.pm and Dahdi::Hardware::USB.pm . For PCI it is possible to detect by sub-vendor and sub-product ID as well. The first output column is the connector: a bus specific field that shows where this device is. The second field shows which driver should handle the device. a "-" sign marks that the device is not yet handled by this driver. A "+" sign means that the device is handled by the driver. For the Xorcom Astribank (and in the future: for other Dahdi devices) some further information is provided from the driver. Those extra lines always begin with spaces. Example output: Without drivers loaded: usb:001/002 xpp_usb- e4e4:1152 Astribank-multi FPGA-firmware usb:001/003 xpp_usb- e4e4:1152 Astribank-multi FPGA-firmware pci:0000:01:0b.0 wctdm- e159:0001 Wildcard TDM400P REV H With drivers loaded, without -v: usb:001/002 xpp_usb+ e4e4:1152 Astribank-multi FPGA-firmware usb:001/003 xpp_usb+ e4e4:1152 Astribank-multi FPGA-firmware pci:0000:01:0b.0 wctdm+ e159:0001 Wildcard TDM400P REV E/F With drivers loaded, with -v: usb:001/002 xpp_usb+ e4e4:1152 Astribank-multi FPGA-firmware LABEL=[usb:123] CONNECTOR=usb-0000:00:1d.7-1 XBUS-00/XPD-00: FXS Span 2 XBUS-00/XPD-10: FXS Span 3 XBUS-00/XPD-20: FXS Span 4 XBUS-00/XPD-30: FXS Span 5 usb:001/003 xpp_usb+ e4e4:1152 Astribank-multi FPGA-firmware LABEL=[usb:4567] CONNECTOR=usb-0000:00:1d.7-4 XBUS-01/XPD-00: FXS Span 6 XPP-SYNC XBUS-01/XPD-10: FXO Span 7 XBUS-01/XPD-20: FXO Span 8 XBUS-01/XPD-30: FXO Span 9 pci:0000:01:0b.0 wctdm+ e159:0001 Wildcard TDM400P REV E/F perl v5.14.2 2009-04-20 DAHDI_HARDWARE(8)
All times are GMT -4. The time now is 09:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy