Command combination for displaying header and content
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
You are given a ANSI text file (a.txt) in the following format and with the following contents-:
Columns are separated with just one space. That means that there is only one space separating name from roll and one space separating roll from marks. There may be multiple spacing in the data as seen in the last column of marks.
The objective is to print the header information and then the details of JOHN only.
The output will look like the following-:
You cannot use two separate commands by using the ";" format to write both commands. You must use pipes and redirection to combine filter commands to get the desired output. 2. Relevant commands, code, scripts, algorithms:
All filter commands can be used. The resultant command must work on a BASH shell and on any Linux distro.
3. The attempts at a solution (include all code and scripts):
Well I have so far attempted two tries-:
But I can't do this even though it works because of the restriction in the problem.
this does not work and the reason is that after running the head command I get only one line and that is printed (which will be header since it is the first line). But I am unable to get the header and the particular record.
Is there someway I can filter within the tee command ?
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
College-: Techno India, Salt Lake
University: West Bengal University of Technology.
City: Kolkata (West Bengal)
Country: India
Professor: Mr. Arun Chatterjee
Course Number-: MCA302
Link to University- : wbut.ac.in (Course 10 is computer applications MCA)
Link to college syllabus-: MCA syllabus (Page 3 of the pdf will contain MCA302 as a listed subject)
Link to college-: ::Techno India Saltlake::
If this information above contains any discrepancy please don't delete this post just tell me and I will try my best to supply the information required.
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Using the fixed length field file called famous.dat make a one-line Unix command - using pipe(s) - to display an... (5 Replies)
i have a input of csv file as below but the sequence of column get changed.
I,e it is not necessary that name comes first then age and rest all, it may vary.
name,age,marks,roll,section
kevin,25,80,456,A
Satch,23,56,789,B
Meena,24,78,H245,C
So i want to print that column entires which... (12 Replies)
Hi everyone,
I have UNIX this semester and I am just getting started with the commands. An interesting question came up while discussing the head and tail commands.
Suppose that I have text file with the following data in the following format-:
NAME ROLL MARKS
Sam 05 ... (2 Replies)
Hi guys !
I generated the power set of the set S={a,b,c} using crunch:
crunch 1 3 abc
and get the 39 possible subsets:
a
b
c
aa
ab
ac
ba
bb
bc
ca
cb
cc
… (2 Replies)
Hi,
I need to display specific columns using select statement and spooled to a file and sending it as e-mail. But i am not seeing column header in my output even i use SET HEADING ON.//PREDEFINED LOGIN DETAILS
${ORACLE_HOME}/bin/sqlplus -s ${DB_LOGIN}/${DB_PASSWD} <<EOF
SET FEEDBACK OFF
SET... (1 Reply)
Hi Team,
Not getting the file output inside my email which i am sending from unix box. . Please refer the below code :
#!/bin/sh
{
sleep 5
echo ehlo 10.56.185.13
sleep 3
echo mail from: oraairtel@CNDBMUREAPZP02.localdomain
sleep 3
echo rcpt to: saurabhtripathi@anniksystems.com... (1 Reply)
Hi All,
I want to send the csv to an email address.
I have tried the below two approaches.
Approach1: Got error -ksh: uuencode: not found
$ uuencode test_file.csv test_file.csv | mailx -s "Attaching test" msdc.kiran@gmail.com </usr/home/test_file.csv
-ksh: uuencode: not found
Approach2:... (6 Replies)