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 bash?

0 Answers  


How to take input values from the user?

4 Answers  


Explain about gui scripting?

0 Answers  


What is computer cli?

0 Answers  


How to calculate the number of passed arguments?

0 Answers  


What is another name for a bash shell script that you might see?

0 Answers  


What are the different methods available to run a shell script?

2 Answers  


Write the syntax for "if" conditionals in linux?

0 Answers  


What is the fastest scripting language?

0 Answers  


Explain about sourcing commands?

0 Answers  


There is a record with fields namely name,roll no.,salary,grade etc.Now,write a script to create a file with multiple records have same combination of fields but with unique roll numbers.The script should work for different names in the input file.

1 Answers   Wipro,


what is the meaning of First line of shell script ,what is meaning of #! pleas explain brifly

4 Answers  


Categories