Search Results

Search: Posts Made By: rockiefx
7,078
Posted By rockiefx
the tabs are not alliged properly to make it a...
the tabs are not alliged properly to make it a seperate field

output:
1(tab)
2(tab)
10(tab)

desired output:
1 (tab)
2 (tab)
3 (tab)
10 (tab)
7,078
Posted By rockiefx
i merged another code with the previous code u...
i merged another code with the previous code u gave -
{print NF?$0:blankrow}blankrow=0{print NR $0 "\t"}
i do get the tabs.. but is it possible to make the tabs like a seperate field?
7,078
Posted By rockiefx
had another concern in the output file.. if i...
had another concern
in the output file.. if i had to add another field with just tab (blank space every line) would
i just say awk '{print NF?$0:blankrow}' blankrow=0; print " "
or awk '{print...
7,078
Posted By rockiefx
lol.. thanks.. worked fine... thanks.. wonders of...
lol.. thanks.. worked fine... thanks.. wonders of pasting..
7,078
Posted By rockiefx
tried that.. didnt work bash: awk{print...
tried that.. didnt work
bash: awk{print NF?$1:blankrow}blankrow=0: command not found
7,078
Posted By rockiefx
replacing blank lines
Hi i am trying to replace blank lines with a number 0. I tried the following code
awk '{print NF ? $0: blankrow}' blankrow = "0" file1.prg>file2.prg
however i get the following error: fatal:...
13,077
Posted By rockiefx
sorry they were the wrong values 32.61 32.44 ...
sorry they were the wrong values
32.61
32.44

i hope you are understanding what i am getting at. i need to manipulate each line and show them as percentage
13,077
Posted By rockiefx
Input : 629 587 584 ...
Input :

629
587
584


output :

34.94
16.85
16.77

(what i am doing here is taking the first line 629 divide it by sum of the field - 1800 and multiplying to give a % of...
13,077
Posted By rockiefx
well i am very new to awk. i just managed to get...
well i am very new to awk. i just managed to get the sum of a field.

awk '{ for (i = 1; i <= NF; i++) s = s+$i }; END { print s /100 }'

i can remove the percentage of the whole field as one.....
13,077
Posted By rockiefx
awk percentage
how would you calculate percentage by per line? Given a column of 16 lines, grab each line and divide it by the sum of the entire column and multiply by 100?
thanks ...
2,384
Posted By rockiefx
basically in colum 3 I am looking at lines that...
basically in colum 3 I am looking at lines that have number 2 and printing them out. how wud i modify the code to incude $4 as well.. check column 4 for lines with #2 in it.
2,384
Posted By rockiefx
percentage by line
hi, I am new to awk.. and getting used to the scripts. I have a small data set 5 coulms.. 16 rows.
1) I am trying to remove the percentages of each line of colum 3..like first line divided the sum...
Showing results 1 to 12 of 12

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