Search Results

Search: Posts Made By: Eric7giants
3,076
Posted By Eric7giants
I'm sorry I thought I typed it out better in the...
I'm sorry I thought I typed it out better in the original post. I will fix that. The .csv file contains 116 lines containing the grades for 5 Students. Each student has multiple Homework, Labs and...
3,076
Posted By Eric7giants
You are absolutely correct I apologize. Before I...
You are absolutely correct I apologize. Before I modified my code I had tested a different variation of my denominator and it had worked but when I made a change it stopped. I do however think I...
3,076
Posted By Eric7giants
The denominator $possible works as I had an...
The denominator $possible works as I had an original bit of code that I did beforehand to make sure it does work.
3,076
Posted By Eric7giants
division by 0
Hello. I'm self teaching myself and coded a program but I keep getting a illegal division by 0 error. I know what it means but I don't know where I am messing up.

Here is the code:

...
2,169
Posted By Eric7giants
Converting awk to perl
Hello. I'm currently teaching myself Perl and was trying to turn an awk code that I had written into Perl. I have gotten stuck on a particular part and a2p has not helped me at all. The task was to...
2,638
Posted By Eric7giants
Converting awk to perl
Hello. I'm trying to convert an awk script I wrote to perl (which I just started self-teaching). I tried the a2p command but I couldn't make sense of most of it.



Here was the awk code:


...
2,508
Posted By Eric7giants
Adding indexes with PERL
Hello. I'm trying to self learn Perl and am stuck. I have a data.csv file that contains the following:




5,10,15,20,15,30
1,2,3,4,5
3,10
11
I'm trying to get Perl to take the indexes and...
1,198
Posted By Eric7giants
awk array
Hello. I'm trying to figure out which one of these is not true about an awk array.


-You do not need to formally declare an array; it is created automatically on first assignment ...
1,910
Posted By Eric7giants
Loop doing calculations
Hello. I'm writing an awk script that looks at a .csv file and calculates the weighted grade for each student based on the scores and categories in the file. I am able to get the script to run the...
2,909
Posted By Eric7giants
as soon as I posted I saw the error. Should ha e...
as soon as I posted I saw the error. Should ha e been sum[$1$2] and not [$1]. However, I am now getting the error "fatal: attempt to use array `total' in a scalar context"
2,909
Posted By Eric7giants
Fatal division by zero attempted
Hello. I'm writing an awk script that looks at a .csv file and calculates the weighted grade based on the scores and categories in the file. I keep getting a fatal division by zero attempted error...
3,432
Posted By Eric7giants
Shell script to call and sort awk script and output
I'm trying to create a shell script that takes a awk script that I wrote and a filename as an argument. I was able to get that done but I'm having trouble figuring out how to keep the header of the...
3,075
Posted By Eric7giants
Awesome. Thanks for all of your help. Quick...
Awesome. Thanks for all of your help. Quick question just for learning purposes. If I wanted to put the "print T" in the END {}, how would I do that. I put it in there and it just prints 10.
3,075
Posted By Eric7giants
Thanks, that does work. I was trying to learn how...
Thanks, that does work. I was trying to learn how to code the solution in an awk script with Begin {} {} End{} and not using any of the built-in awk functions.
3,075
Posted By Eric7giants
Not at all. It just prints "Output" and then a...
Not at all. It just prints "Output" and then a single empty line. I was able to get it to print the first 5 but that was it
3,075
Posted By Eric7giants
awk script to "clamp" numbers.
Hello. I'm new to the command line and am self teaching how to use it. I have a .csv file that contains the following data:
5,10,15,30,8,3,9,10,11,3,12

I'm trying to write an awk script that...
2,720
Posted By Eric7giants
So if I want to turn that line of code into the...
So if I want to turn that line of code into the format I had mentioned:


BEGIN { } { } END { }

Am I even in the ballpark with the following?
begin{
IFS=","
}

{
t=0;
if ($1 ==...
2,720
Posted By Eric7giants
It doesn't. I just wanted to learn how to put it...
It doesn't. I just wanted to learn how to put it in a cleaner format (script) like:


BEGIN {


}


{


}


END {


}
2,720
Posted By Eric7giants
awk script Equivalent .
Hello. I wrote some code for an awk command but I want to learn to turn it into an awk script but am stuck. I have a file (data.csv) that has the following data:


ADD,1,3,5,8,10,11,54...
2,579
Posted By Eric7giants
Positional parameters in if statement
I am trying to code an if statement that accepts two parameters and see if those parameters are in another file called teledir.txt. If it already exists in the file, it is to say "Entry Exists". If...
2,282
Posted By Eric7giants
The issue I'm running into is that if I enter a...
The issue I'm running into is that if I enter a number as a parameter, it functions correctly, but when I enter a name, nothing happens.


#!/bin/bash

name=$1
number=$2

if [ $# -eq 0 ];...
2,282
Posted By Eric7giants
Thanks for all of the help. I truly appreciate...
Thanks for all of the help. I truly appreciate it. I am running into one more issue. When I enter a positional parameter of a name that I know is in the file. It still outputs as name does not exist....
2,282
Posted By Eric7giants
If statement arguments
I'm stuck on a particular problem and need some guidance. I have a file with a name and a phone number in it (teledir.txt). I need to do a $# in a separate script to take a positional parameter and...
1,750
Posted By Eric7giants
Syntax for if statement
I'm new to unix and the command line and am trying to learn different commands. I have a file (teledir.txt) that contains a name and phone number for 3 different people. I am writing a script that is...
1,635
Posted By Eric7giants
For loop for seperate files
For shell script. If I had two separate files, file.txt and file1.txt and each has just a list of names from the who command. How would I create an if loop to compare each name?
Showing results 1 to 25 of 25

 
All times are GMT -4. The time now is 04:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy