in the STOP line below the 0.00000000000 I need the first coloumn of the last line ie in this case 1511.482910. In each file the value will be changing.
I'm having more than 500 of such files.
I believe a shell script or awk can handle this. Please help me.
If the line you want is the last line of the file:
If not, how do you determine which line you want?
for finding out the value of the last line's first coloumn I will use
awk '{field = $1 }; END {print field}' filename
but my need is to print this value next to STOP.
It would have been easier for willing repliers
if you had provided us with line numbers so that it gets conspicuous what characters still belong to the same line.
This is rather ambiguous
Quote:
in the STOP line below the 0.00000000000 I need the first coloumn of the last line
Depending whatever you consider a valid field separator for this file
if it really is in the same STOP line,
it should be as simple as e.g.
But I guess this wasn't meant?
If it were on the other hand on a different line following the STOP marker
(can't fathom what ~xxxxx shall denote) then you would have to parse this line.
Sticking with the assumed line count, and assuming GNU grep was available
you could then maybe do something like
But I don't want to fall prey to era's useless use content here,
why this could better be accomplished in a single awk statement
after you have told us how the line counting goes.
for finding out the value of the last line's first coloumn I will use
awk '{field = $1 }; END {print field}' filename
but my need is to print this value next to STOP.
You haven't answered the question: How do you determine which line contains the value?
In the example you gave, that line is not "next to STOP".
Hi all,
I want ot print a header with new line in the end. I am using echo
like echo "this is header"
I want output like
This is header
$
I tried -e also but it's not working. echo - e
Can anyone help please? (6 Replies)
I have a list of more than 1000 files on the following format.
roman_pottery_in_the_archaeological_record_2007.pdf
power_politics_and_religion_in_timurid_iran_2007.pdf
toward_a_theory_of_human_rights_religion_law_courts_2006.pdf
i_was_wrong_the_meanings_of_apologies_2008.pdf
I want to... (2 Replies)
Hi Team,
I am trying to get the data in below format
Jan 01 | 19:00:32 | xyz | abc | sometext | string
however I am not sure of the total number strings which can come in the record hence i cant use something like below as it can end $6 or it can go further
cat file| awk... (8 Replies)
Hi Guys ,
I Need to insert records into a file just above the last row .
like i have a file which has records as shown below :
00012919 7836049 S
00012920 7836049 S
00012921 3828157 Y
00012922 3828157 Y
00012923 3828157 S
T005290070331000012923
i want to... (1 Reply)
Hello,
I am new to this forum. I have a question in Unix shell scripting. Here is my requirement
I have 1000 files and I need to insert a header with one line at the top of
each of the 1000 files. Please let me know if you have any solution for this
Thanks in advance.
Raj (4 Replies)
Hi
I would like to add lines to a file at specific locations.
eg: If I have a file containing data...
ABC
DEF
GHIJKLKMNOP
RSTUVWXYZ
and I have a requirement to insert a lines
a) "LINE_FIRST" before first line in the file
b) "LINE_X" before third line in the file
c) "LINE_LAST"... (2 Replies)
I have a file where each line starts with a "update" statement. I want to insert a new line, after each line, with the words "go" in the new line. Can someone help me out with this? (1 Reply)
guys can anyone tel me how to insert a line in a file(bash) using line number
i wanna insert the line using LINE NUMBER...i know for inserting above or below a perticular line we can use sed a\ or i\....
thanks in advance.... (7 Replies)
I am trying to reformat some UK postal codes. I have a csv where field 12 is the postal code. The postal codes length has a maximum of 7.
Basically, I would like a bit of code to look at field 12 and if the postal code has a length of 7, then insert a space into the field fourth from the right,... (3 Replies)