Sponsored Content
Top Forums UNIX for Dummies Questions & Answers awk truncating first field output? Post 302921872 by trashmouth12 on Monday 20th of October 2014 04:28:40 PM
Old 10-20-2014
Sorry,
here is the output and source in text format

Code:
 ./getRecordByName.awk on
 3958231  Claribel Cone     3   25  16  21  6   12  12  25  78

18273475  Shawn Tornton     3   25  16  21  6   12  22  43  106

 8273231  Glenn Ikonomov    10  20  11  18  5   12  24  41  86

92839115  Scott Trouchon    10  30  20  25  10  15  31  29  101

input file:
Code:
Student Number:Name:Lab1:Lab2:Lab3:Lab4:Lab5:Lab6:Exam1:Exam2:Final

18273640:Annette Adams:8:24:19:24:10:12:43:35:98
93840219:Mary Beard:9:30:19:23:10:14:29:39:87
23958552:Antoinette Brown:9:16:18:22:9:12:19:31:79
23958231:Claribel Cone:3:25:16:21:6:12:12:25:78
23958548:Ema Chang:8:22:16:23:9:x:15:28:69
23958664:Heesook Kim:6:20:14:24:7:12:x:39:98
23958115:Larry Liu:7:23:12:24:9:13:43:35:98
23958238:Brad Lee:9:27:18:22:9:12:36:38:102
18273165:Eric Ko:7:23:12:24:9:13:31:42:95
18273239:Richard Ko:9:16:18:22:9:12:28:30:96
18273475:Shawn Tornton:3:25:16:21:6:12:22:43:106
18273427:Omar Maghardi:6:20:14:24:a:12:30:40:100
18273975:Scott Yau:10:30:20:25:10:15:41:45:110
18273231:Glenn Ikonomov:10:20:11:18:5:12:24:41:86
92839115:Scott Trouchon:10:30:20:25:10:15:31:29:101
92839985:Patric Zhou:9:16:18:22:9:12:a:31:98
92839344:Zhanfang Li:10:22:20:22:10:15:24:37:102
92839342:Robert Bloomingdale:9:26:18:22:9:12:25:39:99
92839633:Patricia Garibaldi:7:23:12:24:9:13:32:42:107
92839654:Svetlana Rusova:6:20:14:24:7:12:34:41:109
92839443:Aleksei Titov:3:25:16:21:6:12:38:45:112
92839864:Xiaowei Young:10:20:11:18:5:12:29:37:96
92839428:Guan Wang:9:27:18:22:9:12:29:40:101

Number of Labs:6
Number of Exams:2

Maximum points per Lab
Lab1:10
Lab2:30
Lab3:20
Lab4:25
Lab5:10
Lab6:15

Maximum points per Exam
Exam1:50
Exam2:50

Maximum points on Final
Final:150


Quote:
Originally Posted by RudiC
Is it possible you are dealing with a DOS/windows file using \r\n as a line separator? That'd be the only reason I could find just staring at the images.
I'm logged in to a Linux server using SSH through OSX. Same error occurs when I ssh through Windows to the same server using PuTTY.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Truncating a number using sed/awk

Hi all, I'm trying to truncate a number like the following: 0001060407013900501048239559900600504083525826350002050354795057 I would like to create an output which puts carriage returns every so many characters, giving an output such as: 0001 060407 0139 0 05 010482395599 0060... (4 Replies)
Discussion started by: michaeltravisuk
4 Replies

2. Shell Programming and Scripting

how to include field in the output filename of awk

Im using awk and I want the output filename to contain the first field of the input file. Ex. 1 dddd wwwww 1 eeeee wwww 1 wwww eerrrr 2 eeee eeeeee I want the output files to be xxx1 and xxx2 Thank you (4 Replies)
Discussion started by: yahyaaa
4 Replies

3. Shell Programming and Scripting

Supressing and replacing the output of a field in Awk

Wondering if anybody can help with changing the output of a field. I'm needing to change the output of a field in this file: User Process ID Time Active Licences Type ChangeAdmin (Phys-agsdev/19353 212), start Wed 1/21 6:30 (linger: 1800) u414013 (Phys-agsdev/19353 1491), start Wed 1/21 12:54... (5 Replies)
Discussion started by: Glyn_Mo
5 Replies

4. Shell Programming and Scripting

Using AWK to format output based on key field

I have file which contains gene lines something like this Transcript Name GO POPTR_0016s06290.1 98654 POPTR_2158s00200.1 11324 POPTR_0004s22390.1 12897 POPTR_0001s11490.1 POPTR_0016s13950.1 14532 POPTR_0015s05840.1 13455 POPTR_0013s06470.1 12344... (6 Replies)
Discussion started by: shen
6 Replies

5. Shell Programming and Scripting

awk output field delimiter

Dear All, 1.txt (tab in between each value in a line) a b c a b c a c d you can see below, why with ~ i can output with tab, but = cannot? # awk -F'\t' '$2 ~ /b/' 1 a b c a b c # awk -F'\t' '$2 = "b"' 1 a b c a b c a b d ... (1 Reply)
Discussion started by: jimmy_y
1 Replies

6. Shell Programming and Scripting

nawk is truncating output

Legends, I have 2 files f1 and f2. when i use nawk to compare the difference(subtraction) from 4th column of the file, it truncates the output. can you please help to resolve this. subtraction is (4th col of f1 - 4th col of f2). but it gives only below lines out of 116. I want to print all... (7 Replies)
Discussion started by: sdosanjh
7 Replies

7. UNIX for Dummies Questions & Answers

awk - output field separator

In awk, how do I print all fields with a specified output field separator? I have tried the following, which does not print the output FS: echo a b c d | awk 'BEGIN{OFS = ";"}{print $0}' (3 Replies)
Discussion started by: locoroco
3 Replies

8. Shell Programming and Scripting

awk calculation wrong field output

The awk below is close but I can't seem to fix it to produce the desired output. Thank you :). current awk with output awk '{c1++; c2+=($2)} END{for (e in c1) print e, c1, c2}' input EFCAB5 2 50 USH2A 2 19 desired... (8 Replies)
Discussion started by: cmccabe
8 Replies

9. Shell Programming and Scripting

Using awk to print output based on first field.

Hi Folks, I have one requirement, There is one file, which contains two fields. Based on first field, I need to print an output. Example will be more suitable. Input file like this. abc 5 abc 10 xyz 6 xyz 9 xyz 10 mnp 10 mnp 12 mnp 6 (2 Replies)
Discussion started by: Raza Ali
2 Replies

10. Solaris

How to avoid truncating in ps output ?

Hello, This is Solaris 10 (x86) bash-3.2# cat /etc/release Solaris 10 5/09 s10x_u7wos_08 X86 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 30 March... (5 Replies)
Discussion started by: solaris_1977
5 Replies
ScottFree(6)							   Games Manual 						      ScottFree(6)

NAME
scottfree -- interpreter for Scott Adams database game files SYNOPSIS
scottfree [-d] [-i] [-y] [-s] [-t] [databasename] [save-file] DESCRIPTION
This manual page documents briefly the scottfree command. This manual page was written for the Debian distribution because the original program does not have a manual page. Instead, it has docu- mentation in text format; see below. scottfree is a program that reads and executes TRS80 format Scott Adams datafiles. OPTIONS
-d Debugging info on load. -i Generate "I am"-style messages. (default) -y Generate "You are"-style messages. -s Generate authentic Scott Adams driver light messages rather than other driver style ones. -t Generate TRS80 style display. SEE ALSO
/usr/share/doc/scottfree/ AUTHOR
This manual page was written by Clint Adams <schizo@debian.org> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation. ScottFree(6)
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy