- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cut the specific column
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2004 02:02 PM
08-26-2004 02:02 PM
#vi test.txt
11 22 3333
aa bb ccc
, they are separated by the space , how can I cut the third column as below.
3333
ccc
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2004 02:12 PM
08-26-2004 02:12 PM
SolutionI work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2004 02:28 PM
08-26-2004 02:28 PM
Re: cut the specific column
cut -d " " -f 3 test.txt
-d is the delimer
-f is the field number
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2004 03:18 PM
08-26-2004 03:18 PM
Re: cut the specific column
I dislike one detail in Dave's solution.
Why activate an additional image (cat) and create a fresh pipe to move the data twice when awk is perfectly happy to read teh file directly?
Furthermore, the all too often (mis)used "cat
Notably, it can no longer 'see' the original filename, useful for good error reporting.
Not relevant for this question perhpas, but in general...
Examples:
$ cat xxx
aap noot mies teun
een twee drie vier
$ awk 'BEGIN {print FILENAME}{print $3}' x
xxx
mies
drie
$ cat x | awk 'BEGIN {print FILENAME}{print $3}'
mies
drie
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2004 05:58 PM
08-26-2004 05:58 PM