Following awk
could help you in same.
awk '{print > NF"column.txt"}' Input_file
Output it will create 3 files named 5column.txt
, 4column.txt
and 3column.txt
.
Related Contents:
- How can I do a recursive find/replace of a string with awk or sed?
- Bash tool to get nth line from a file
- How to merge every two lines into one from the command line?
- Remove first N lines of a file in place in unix command line
- How to add to the end of lines containing a pattern with sed or awk?
- How to remove double-quotes in jq output for parsing json files in bash?
- How to grep for case insensitive string in a file?
- Scripts for computing the average of a list of numbers in a data file
- how to find a regular expression of specific string
- How do I use shell variables in an awk script?
- sed substitution with Bash variables
- How to pass a variable containing slashes to sed
- sed search and replace strings containing / [duplicate]
- Recursively rename files using find and sed
- bash: shortest way to get n-th column of output
- Error when using ‘sed’ with ‘find’ command on OS X: “invalid command code .”
- awk in bash with ls and variable
- How can I remove the first line of a text file using bash/sed script?
- How to address error “bash: !d’: event not found” in Bash command substitution [duplicate]
- Remove Unicode characters from textfiles – sed , other Bash/shell methods
- How to replace an entire line in a text file by line number
- Using sed to mass rename files
- Sort a text file by line length including spaces
- Parsing variables from config file in Bash
- Use sed to replace all backslashes with forward slashes
- Delete all lines beginning with a # from a file
- Extraction of data from a simple XML file
- Bash: Parse CSV with quotes, commas and newlines
- Specify other flags in awk script header
- Easiest way to extract the urls from an html page using sed or awk only
- How to make awk ignore the field delimiter inside double quotes? [duplicate]
- Parse out key=value pairs into variables
- Insert newline (\n) using sed
- Why does sed not replace all occurrences?
- How do I escape slashes and double and single quotes in sed?
- Insert multiple lines into a file after specified pattern using shell script
- Use awk to find average of a column [duplicate]
- Uppercasing First Letter of Words Using SED
- Check if all of multiple strings or regexes exist in a file
- Expand variables in sed
- Split CSV files into smaller files but keeping the headers?
- How to use a bash script variable with sed [duplicate]
- sed multiline delete with pattern
- Error with sed unterminated s command in bash
- How can I format the output of a bash command in neat columns
- How to match a single quote in sed
- What is the shortest way to get n-th column of an output?
- Escaping forward slashes in sed command [duplicate]
- How to use ‘find’ to search for files created on a specific date? [closed]
- How do you run a command eg chmod, for each line of a file?