How to handle the delimiter unit seperator in Unix
Answers were Sorted based on User's Feedback
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 |
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 |
What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?
What are the 4 basics of OOP?
Is shell scripting easy to learn?
How would you print just the 25th line in a file using smallest shell script?
write a shell script to emulate the Id command of PRIMOS which lists files and directories. It list files first with a header FILES and then directories with a header DIRECTORIES. This command has several options. The main ones are. -file select files only -dir select directories only -reverse sort in reverse order -no_header put no header on the output -brief output the header only -size display the size of each file -help display Id´s syntax and options.
How to print all array elements and their respective indexes?
What are the advantages of shell script?
How to know that your remote server is ruing smoothly or not in unix?
What is the best shell scripting language?
What are the different communication commands available in the shell?
What are the two files of crontab command?
How to group the commands in shell scripting?