This is a discussion on need help in getting a part from a file. within the Shell scripting forums, part of the Development/Scripting category; My files name is Prices it contains: Products:Company1:Company2:Company3 Monitor:23:34:45 Keyboard:34:45:56 Printer:...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
My files name is Prices
it contains: Products:Company1:Company2:Company3 Monitor:23:34:45 Keyboard:34:45:56 Printer:21:40:22 Scanner:32:66:45 How can i get the number 66 form the line "Scanner:32:66:45". ![]() Thanks very much! |
|
||||
|
Try cut command to print 3rd field using : as a delimiter
Code:
echo 'Scanner:32:66:45' | cut -d: -f3
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
![]() |
| Bookmarks |
| Tags |
| cut , shell script |
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sun Certified System Administrator for the Solaris 10 OS, Part I (CX-310-200) | nkechifesie | Solaris/OpenSolaris | 8 | 02-18-2008 01:44 PM |
| Read arguments from a file and pass them to binary file | AHJ | Shell scripting | 1 | 10-31-2007 06:04 PM |
| Script to extract some part of files: | satish1482 | Shell scripting | 0 | 03-13-2007 05:30 PM |
| FreeBSD setup ACL or Access control list tutorial part # 1 | nixcraft | Getting started tutorials | 2 | 12-20-2006 01:55 AM |
| convert pdf (ppt file) into wordppt file | sureshbup | Linux software | 1 | 12-07-2006 03:51 PM |