Asked • 05/03/19

use space as a delimiter with cut command?

I want to use space as a delimiter with the `cut` command. What syntax can I use for this?

1 Expert Answer

By:

Raj R.

short-option won't work as there can be only one character after -d option...Instead if you use -d' ' you will get Error: the delimiter must be a single character...To replace the default Delimiter, use the long option --delimiter=' '....
Report

08/05/22

Raj R.

In Case you are using short option, give a space between -d and the delimiting character like -d ' ' Else You will get Error: the delimiter must be a single character...Else Use the long option --delimiter=' '
Report

08/05/22

Louis I.

tutor
?? What Linux/UNIX platform are you using? This works for me on Redhat as well as Cygwin running on Windows $ cat file1 lou joseph 1234 becca anne 9876234 lji@DESKTOP-OIE4IU7 ~ $ cut -d' ' -f3 file1 1234 9876234 This also works: $ cut -d" " -f3 file1 1234 9876234 Are you using -d along with -f ?
Report

08/05/22

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.