Try:
tr -s ' ' <text.txt | cut -d ' ' -f4
From the tr
man page:
-s, --squeeze-repeats replace each input sequence of a repeated character that is listed in SET1 with a single occurrence of that character
More Related Contents:
- Some troubles with using sed and awk [closed]
- What does 2>&1 mean here?
- In the shell, what does ” 2>&1 ” mean?
- An efficient way to transpose a file in Bash
- Bash command line and input limit
- Delete all but the most recent X files in bash
- How do I check if a directory exists in a Bash shell script?
- Checking from shell script if a directory contains files
- How to determine the current interactive shell that I’m in (command-line)
- How to use ‘find’ to search for files created on a specific date? [closed]
- Removing colors from output
- How to represent multiple conditions in a shell if statement?
- How to provide password to a command that prompts for one in bash?
- How to search filenames by regex with “find”
- How does this bash fork bomb work? [duplicate]
- Piping tail output though grep twice
- What is a unix command for deleting the first N characters of a line?
- How to split a string in shell and get the last field
- How to go to each directory and execute a command?
- Reading filenames into an array
- Bash: Parse CSV with quotes, commas and newlines
- What’s a concise way to check that environment variables are set in a Unix shell script?
- executing shell command in background from script [duplicate]
- Waiting for background processes to finish before exiting script
- Variables as commands in Bash scripts
- How to split a file into equal parts, without breaking individual lines? [duplicate]
- Copy all files with a certain extension from all subdirectories
- How can I convert tabs to spaces in every file of a directory?
- File content into unix variable with newlines
- Reading null delimited strings through a Bash loop