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

What is Path variable?What is its use?

1 Answers  


write a shell script that accepts name from user and creates a directory by the path name, then creates a text file in that directory and stores in it, the data accepted from user till STOP, displays the no. of characters stored in the file.Program stops if directory name is null

1 Answers  


HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?

3 Answers   Patni,


How to get the 3rd element/column from each line from a file?

0 Answers  


How do I run a .sh file?

0 Answers  






What is "test"? How it is used in shell scripting?

2 Answers  


What are the different communication commands available in the shell?

0 Answers  


What is the difference between grep and egrep?

0 Answers  


What is a boot block?

0 Answers  


How do I run a shell script in powershell?

0 Answers  


What language is used in terminal?

0 Answers  


how to get part of string variable with echo command only?

0 Answers  


Categories