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:
I have to join 3 files numerically according to ID(first column) with no comments. In the end i'll be something like this to a Marks file.
54546547 7 7 5
12345678 4 5 6
etc
What I think my problem is, is that there's something wrong with my first join. despite my final output being spaced correctly.
When i submit it to the system that checks my program it says:
I have 3 files Prac1, Prac2 and Prac3. Each student cannot have missed all pracs but can miss 2. So they have to have some marks. 2. Relevant commands, code, scripts, algorithms:
I must use join and sort nothing else. So no awk solutions. Must be sorted numerically.
3. The attempts at a solution (include all code and scripts):
part1temp1
Marks
If you notice in my final output(Marks) it's fine. sorted numerically, spacing is good. but in part1temp1 the id's 87686546 and 90948695's marks are supposed to have moved over by 1 space as they are prac2 marks.
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Monas University, Melbourne, Vic, Australia, John Hurst, FIT3042
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).
sorry i've solved it. it was the way the question was written. didn't need to leave a space for empty pracs.
Hi,
Please explain the working process of join command.
File 1
P B
S A
C AFile2
C B
P A
S DBut the output of join command is...
join File1.txt File2.txt
P B A
S A DBut I guess the output should be
P B A
S A D
C A BPlease correct me,if i am worong or missing some thing.
Thanks (2 Replies)
Hi,
I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt. Each file has 3 columns (2 other columns in addition to the first common column).
I want to write a script to join the files by the first common column so that in the... (5 Replies)
I'm trying to combine text files without a space. So if i use the paste command
paste file1 file2 file3 > file4
the new file created has spacing between the contents of the once individual files. Is there some trick I can do with a delimiter that removes the spaces.. like paste -d'' or... (1 Reply)
All,
I have 3 files (tab seperated):
Note: Please treat dash (-) as empty value in the file, I have added it to make input easily readable
file1: (2 cols)
A 1
B 2
C 3
file2: (4 cols - col4 has empty values for 4th column except 2nd row)
A 1 5 -
B 2 6 Y
C 3 7 -
D 4 8 -
file3... (1 Reply)
Dear Experts,
I have several (say 'm') text files, each with 'n' columns. I want to put them into a large single file with n*m columns.
a 1 a 1 a 1 a 1
b 2 b 5 b 1 b 3
c 3 c 7 ... (1 Reply)
Hi,
I am a new learner of join command. Some result really make me confused.
Please kindly help me.
input:
file1:
LEO oracle engineer 210375
P.Jones Office Runner ID897
L.Clip Personl Chief ID982
S.Round UNIX admin ID6
file2:
Dept2C ID897 6 years
Dept5Z ID982 1 year
Dept3S ID6 2... (1 Reply)
Hi,
I'm using the join command and it appears to discard certain fields. Here are the two files i'm comparing:
File1:
1 a
2 b
3 c
4 d
99 f
101 g
999 i
200 j
File 2:
1 e
2 f
3 g
4 h
99 h (22 Replies)