Calculate difference between list of numbers from a file [duplicate] - bash

This question already has answers here:
Awk command - calculation of columns
(2 answers)
Closed 8 years ago.
I've a file with a list of numbers as below
37298.1
37304.1
37310.3
37316.5
37322.5
37328.7
I need to calculate the difference between each number in the list with respect to the previous one, as showed below:
6.0
6.2
6.2
6.0
6.2

awk 'p{print $0-p}{p=$0}' file

Related

How to read a specific line data [duplicate]

This question already has answers here:
VBScript to read specific line and extract characters and store it as a variable
(2 answers)
How to delete the first row in the .csv file
(2 answers)
Closed 5 years ago.
I want to read a specific line from the text file using VBScript.
I have explored Read and ReadLine methods but I can't able to read only specific line from text file. (I have 1000 of line but I want to read only 99 or 200 or 500 line only)
The question may be similar to the questions those duplicate hunters pointed to, but the answers are - for different reasons - of no use. A good answer could be build from one answer to the completely different question here.
Now to the answer:
Use a .SkipLine loop to read to the line before you are interested in and get it using .ReadLine.

How can I strip data from website table using ruby? [duplicate]

This question already has answers here:
Extract data from HTML Table with mechanize
(3 answers)
Closed 7 years ago.
For example, I only want "1:30pm" from this data that I got using xpath:
"1:30pm Manila Bulletin"
One way to accomplish it is "1:30pm Manila Bulletin".split(/\s/).first.

Splitting a string into blocks [duplicate]

This question already has answers here:
Split string into equal slices/chunks
(2 answers)
Closed 7 years ago.
I was wondering how I could program something to split a string into blocks of five using Ruby. Help much appreciated.
You can use String#scan method to achieve it. E.g 'string_test'.scan(/.{1,5}/)

Commas in path - .NET [duplicate]

This question already has answers here:
Commas in WPF Pack URIs
(2 answers)
Closed 7 years ago.
I am working on some code that has paths that look like this:
"pack://application:,,,/FOO.Bar.Baz;component/Gorp/bazzle.xaml"
What do the 3 commas mean, and what is this path referencing?
Typically they are placeholders for parameters that were not supplied. It usually means ... "use the default values" for those parameters.

how to get line number in code editor in vs2008? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How do I enable line numbers in VS2008?
how to get line number in code editor in vs2008?
Tools...Options...Text Editor....All Languages... Display... Line Numbers.
go to tool>option>text editor check 'line number'

Resources