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 scripting useful?

596


How does ls command work?

588


How to find all the files modified in less than 3 days and save the record in a text file?

615


How can you get the value of pi till a 100 decimal places?

553


How do I save a powershell script?

562






determine the output of the following command: echo ${new:-variable}

549


Explore about environment variables?

598


How to print the first array element?

557


How do I run a .sh file?

620


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

755


What is the significance of $#?

593


What is difference between bash and shell?

558


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

3591


How do I open a jshell in cmd?

602


What does $1 mean in bash?

616