So, I have a couple of scripts that go through lots and lots of data-- sometimes thousands of smaller files, sometimes a few very large ones. It's very common that I need a particular line, by line number X. There are lots of ways to do this:
There are others, too... My question is, what's the most economical way you know to do this? In my primitive tests (involving a large file and the time command), head/tail seem to be the winner. What is surprising is how badly sed did. On a file with 4237905 lines, here are the results:
I actually expected sed to win. Strange... Anyway, are there any other methods I should consider? Are there improvements to these methods? Thanks.
I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like:
What I... (3 Replies)
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
I am very new to scripting and have a prb since few days and it is urgent to solve so much appreciated if u help me.
i have 2 files
9647810043250... (22 Replies)
i have file which contains data as below(Only sample shown, it may contain more data similar to the one shown here)
i need to read this file line by line and generate an output file like the one below
i.e based on N value the number of MSISDNs will vary, if N=1 then the following... (14 Replies)
So, I want to read line-by-line a text file with unknown number of files....
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)