Only there are,this time, the spaces between station information and the time information increased and there are only 2 digits for the time information the rest is the same
The rest is not the same.
The first header is no longer the same length as subsequent headers. Lines with less than 6 stations do not have subsequent fields with zero values; they are now absent. The mark line between events which contained a 0 in each field is now a single zero.
Does the file now contain nullbytes? I ask because that would not be a good thing, because ^@ is the usual visual representation of a nullbyte, and because your sample data now includes 24-Jul-12 ^@^@^@^@^@^@^@^@.
If the file format isn't set in stone, I would suggest implementing something that's easier to parse. Use a tab to delimit fields. Have only a single station and time value per line. A blank line can delimit events, instead of a line with a zero (or multiple zeroes). Or perhaps no marker is required. If each station line consisted of two fields (station name <tab> time), and if the header is always guaranteed to be more than 2 fields, the field count would be sufficient.
A simple format, after any necessary processing (such as adding the noise), can be easily converted to another format (perhaps of fixed-width if that's a requirement). Just a thought.
Regards,
Alister
---------- Post updated at 10:02 AM ---------- Previous update was at 09:55 AM ----------
Quote:
Originally Posted by raj_saini20
Try this (tested in hp-ux)
Please, in the future, avoid such long lines and format the code with proper indentation (there are at least 3 levels of nesting in there). Even for an expert, they are difficult to comprehend. For a novice, nearly impossible. To make matters worse, unless someone is using a very wide display resolution and has the browser maximized, your post and every post that quotes yours requires tedious scrolling to read.
This part can be eliminated from the file it is not so much important and the rest of the file does not contain any signs like this.
I know that the header lines are not the same as before but the that given says me,ı guess, process the lines only starting with letters, else write the whole line as it is. So I thought that it is not important that the line length has changed... You would be right i am not so sure
It is working again perfectly, I also changed the format of the of the 1st file as the previous one (another way to solve the problem ), But changing it might effect other parts of the code which reads the file in a specific format, This way, thanks to your code, is much much better and safe so Thank you very much I ll try to understand the code
Hello,
I have a shell script through which I am executing .sql file and spooling the result of Query from .sql . I want to spool the result in ascending order. Is there any parameter to be set to print result in ascending or descending order.
Thanks in advance. (4 Replies)
is it possible to order the following row clusters from ascending to descending. thanx in advance
input
1 2 4 0
1 2 4 0
3 3 3 3
1 5 1 0
1 5 1 0
6 0 0 0
5 1 1 1... (4 Replies)
Hi folks
I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file.
It all works - apart from the xml and config file format in the new file
with XML files the original XML (that ends up in... (2 Replies)
Hi experts,
I have a list of files containing forces as the only number as follows.
Force1.txt Force2.txt Force3.txt Force4.txt Force5.txt . . . . . . . . . Force100.txt I want to put all the data(only a number ) in these forces files in the file with the same order like 1,2,3 ..100 .... (2 Replies)
I want to generate an awk function that generated a Gaussian distributed set of random numbers. I need to implement the thing below in awk. Rnd is just a uniform random number between 0 and 1
function rgaussian(r1, r2) {
Do
v1 = 2 * Rnd - 1
v2 = 2 * Rnd - 1
... (0 Replies)
Hi guys, I'm having some difficulties in insert some details to the following contents.
I need to insert "TEST" under MIR & a value "25" to the next line.
So far, I am able to insert "TEST" by using awk to capture MIR as the identifier.
However, I am having some difficulties in inserting "25"... (3 Replies)
Hi
I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example.
The original data record should be some thing like this
60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Hi All,
I enhanced a perl script that creates a table with xyz_yyyymm and insert data from xyz table before truncate xyz.I have tested it successfully in dev but when i ran it on production new table xyz_yyyymm created but did not insert any records from xyz.(No errors were thrown)The perl... (1 Reply)
I'm hoping someone can help me on this. I have a data file that greatly simplified might look like this:
sec;src;dst;proto
421;10.10.10.1;10.10.10.2;tcp
426;10.10.10.3;10.10.10.4;udp
442;10.10.10.5;10.10.10.6;tcp
sec;src;fac;dst;proto
521;10.10.10.1;ab;10.10.10.2;tcp... (3 Replies)