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

What is a beat in a script?

632


What is the command to find out today's date?

680


Explain about gui scripting?

714


What is inside a seashell?

756


What are the different variables present in linux shell?

683






Why is a script important?

632


How does ls command work?

678


What is shell environment?

621


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

719


What language is used in terminal?

638


What does $0 mean in shell script?

646


What exactly is a shell?

694


Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

889


How to get the last line from a file using just the terminal?

762


How to print all the arguments provided to the script?

643