Print last row of numbers


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Print last row of numbers
# 1  
Old 02-06-2013
Print last row of numbers

I have a spreadsheet of extremely long rows of numbers. I want to print only the last column. Tried using printf but there seems to be too many rows.

example:
Code:
3 100 34 7 23 0 8 ..... X
          400 203 778 1 ..........Y
             58 3 9 0 100 ..........Z
I only want to print X, Y and Z.

---------- Post updated at 03:43 PM ---------- Previous update was at 03:38 PM ----------

I figured it out!
Code:
awk '{ print $NF }'

# 2  
Old 02-07-2013
Code:
sed 's/.* //'

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sum of numbers in row

Need help in coding: File with several rows incl. numbers like 1 2 3 4 5 6 7 8 ... How can i build the sum of each row seperately? 10 26 ... Thx for help. Please use CODE tags as required by forum rules! (13 Replies)
Discussion started by: smitty11
13 Replies

2. Shell Programming and Scripting

Print row on 4th column to all row

Dear All, I have input : SEG901 5173 9005 5740 SEG902 5227 5284 SEG903 5284 5346 SEG904 5346 9010 SEG905 5400 5456 SEG906 5456 5511 SEG907 5511 9011 SEG908 5572 9015 SEG909 5622 9020 SEG910 5678 5739 SEG911 5739 5796 SEG912 5796 9025 ... (3 Replies)
Discussion started by: attila
3 Replies

3. Shell Programming and Scripting

Get row number from file1 and print that row of file2

Hi. How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg file1 1:abc 3:ghi 6:pqr file2 a abc b def c ghi d jkl e mno f pqr ... (6 Replies)
Discussion started by: Abhiraj Singh
6 Replies

4. Shell Programming and Scripting

Multiply a row of numbers

the following is used to add numbers: echo 7 47 47 44 4 3 3 3 3 3 | awk '{ for(i=1; i<=NF;i++) j+=$i; print j; j=0 }' how do i multiply OR subtract a row of numbers using the above tactic? (8 Replies)
Discussion started by: SkySmart
8 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Add row of numbers

Hi, Trying to add a row of numbers. There are 24 number across. Would like to have column 25 sum each row. 10 3 45 49 0 24... Sum 3 200 3 9 1 3 ...... Sum 9 7 20 9 8 10 ...... Sum Thank you. (5 Replies)
Discussion started by: jimmyf
5 Replies

6. Shell Programming and Scripting

Print the row element till the next row element appear in a column

Hi all I have file with columns F3 pathway CPS F2 H2 H4 H5 H6 no pathway CMP H7 H8 H9 H10 My expected output is F3 pathway CPS F2 pathway CPS (10 Replies)
Discussion started by: Priyanka Chopra
10 Replies

7. Shell Programming and Scripting

extracting non-zero pairs of numbers from each row

Hi all, I do have a tab delimited file a1 a2 b1 b2 c1 c2 d1 d2 e1 e2 f1 f2 0 0 123 546 0 0 0 0 0 0 0 0 0 0 345 456 765 890 902 1003 0 0 0 0 534 768 0 0 0 0 0 0 0 0 0 0 0 0 0 0 456 765 0 0 0 0 0 0 0 0 0 0 0 0 12 102 0 0 0 0 456 578 789 1003 678 765 345 400 801 1003 134 765... (5 Replies)
Discussion started by: Lucky Ali
5 Replies

8. Shell Programming and Scripting

Adding row of numbers

is there another way of doing the below: echo "7 3 8 2 2 1 3 83.4 8.2 4 8 73 90.5" | bc shell is bash. os is linux and sunos. bc seems to have an issue with long range of numbers (12 Replies)
Discussion started by: SkySmart
12 Replies

9. UNIX for Dummies Questions & Answers

Print numbers and associated text belonging to an interval of numbers

##### (0 Replies)
Discussion started by: lucasvs
0 Replies

10. Shell Programming and Scripting

counting the numbers in a row

File A aa <space> --D--A--D---DDY---M--UM-M--MY Another file D3 M9 So output shud be Here in FileA D which is 3 after removing dash after we have counted dash D is position at 9 and for M is 23 final output will be D9 M23 (2 Replies)
Discussion started by: cdfd123
2 Replies
Login or Register to Ask a Question