How to handle the delimiter unit seperator in Unix

Answer Posted / srikanth

create script test.txt with | seperated

The below commands can be used to get the fields values:

awk -F"|" '{print $1}' test.txt

cat sri.txt | cut -d"|" -f1

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is shell and terminal the same?

584


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

924


How do I debug a shell script?

555


How do we create command aliases in a shell?

534


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

691






What will happen to my current process when I execute a command using exec?

531


What is a shell script? Can you name some of its advantages?

522


What is bash coding?

493


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2027


What is the use of break command?

581


What is a program shell?

562


What is shell scripting used for?

567


Explain about "s" permission bit in a file?

603


What is gui scripting?

597


Is powershell a bash?

586