How to handle the delimiter unit seperator in Unix

Answers were Sorted based on User's Feedback



How to handle the delimiter unit seperator in Unix..

Answer / 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

How to handle the delimiter unit seperator in Unix..

Answer / pitambar mishra

Different types of command using delimiter :
1. cut -d "|" -f6 emp.lst
d : delimiter or field separator
2. sort -t "|" -nk6 emp.lst
t : delimiter or field separator
3. awk -F "|" '{print $6}' emp.lst
F : delimiter or field separator

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Shell Script Interview Questions

How to set an array in linux?

0 Answers  


What are the different types of variables used in shell script?

0 Answers  


How to group the commands in shell scripting?

2 Answers   Polaris,


How to print all array elements and their respective indexes?

0 Answers  


how to read systems current date and time

4 Answers  






What can you do with powershell?

0 Answers  


What is MUTEX?

1 Answers  


What is sed in shell script?

0 Answers  


c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command

0 Answers  


shell script for reverse the string

0 Answers  


What is difference between bash and shell?

0 Answers  


What are types of shells?

0 Answers  


Categories