i have a file, where measurement-data is stored in the first column. The file has also a header of 5 lines. I want to set counting up numbers [1, 2, 3, ...] in front of any particular measurement-value; should start at the 6. line with starting number 1.
i try to solve it with ...
..but it will cut the header. Can someone give me a hint, how to give out the complete file?
Hi,
I am currently trying to generate multiple random numbers in C for different variable:-
die1=1+(rand()%5);
die2=1+(rand()%5);
die3=1+(rand()%5);
die4=1+(rand()%5);
But I need to contrain the total of die1, die2,die3 and die4 to be 5 as well. If i insert die1+die2+die3+die4=5, i do... (6 Replies)
Hi i would like to add line numbers to end of each line in a file.
I am able to do it in the front of each line using sed, but not able to add at the end of the file.
Can anyone suggest
The following code adds line number to start of each line
sed = filename | sed 'N;s/\n/\t/'
how can i... (5 Replies)
I have two files one (numbers file)contains the numbers(approximately 30000) and the other file(record file) contains the records(approximately 40000)which may or may not contain the numbers from that file.
I want to seperate the records which has the field 1=(any of the number from numbers... (15 Replies)
I have to take a list of numbers from the keyboard and not by passing arguments. How will I read a set of numbers in such a way that I can use any number I wish to operate upon. Is there any specific command to do so. As said before I dont want to pass the numbers as arguments from command line.... (3 Replies)
Hi! I'm trying to assign line numbers to each line of the file
for example consider the following..
The contents of the input file are
hello how are you?
I'm fine.
How about you?
I'm trying to get the following output..
1 hello how are you?
2 I'm fine.
3 How about you? ... (8 Replies)
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Hi All,
I have one sensor output(over the same) for a set value of 20.
Time(in Sec), Data
1, 16
2, 20
3, 24
4, 22
5, 21
6, 20
7, 19.5
8, 20
9, 20.5
10, 20
11, 20
12, 19.5
Here we can see like after 5 sec of time the data value reaches to 20+-0.5 range.
So I... (7 Replies)
Hi Experts,
I have a data with multiple entry , I want to filter PKG= & the last column "00060110" or "00088150" in the output
file:
###############################################################################################
PKG= P8SDB :: VGS = vgP8SOra vgP8SDB1 vgP8S001... (5 Replies)
STRFILE(8) BSD System Manager's Manual STRFILE(8)NAME
strfile, unstr -- create a random access file for storing strings
SYNOPSIS
strfile [-Ciorsx] [-c char] source_file [output_file]
unstr source_file
DESCRIPTION
The strfile utility reads a file containing groups of lines separated by a line containing a single percent '%' sign and creates a data file
which contains a header structure and a table of file offsets for each group of lines. This allows random access of the strings.
The output file, if not specified on the command line, is named source_file.dat.
The options are as follows:
-C Flag the file as containing comments. This option cases the STR_COMMENTS bit in the header str_flags field to be set. Comments are
designated by two delimiter characters at the beginning of the line, though strfile does not give any special treatment to comment
lines.
-c char Change the delimiting character from the percent sign to char.
-i Ignore case when ordering the strings.
-o Order the strings in alphabetical order. The offset table will be sorted in the alphabetical order of the groups of lines refer-
enced. Any initial non-alphanumeric characters are ignored. This option causes the STR_ORDERED bit in the header str_flags field
to be set.
-r Randomize access to the strings. Entries in the offset table will be randomly ordered. This option causes the STR_RANDOM bit in
the header str_flags field to be set.
-s Run silently; do not give a summary message when finished.
-x Note that each alphabetic character in the groups of lines is rotated 13 positions in a simple caesar cypher. This option causes
the STR_ROTATED bit in the header str_flags field to be set.
The format of the header is:
#define VERSION 1
uint32_t str_version; /* version number */
uint32_t str_numstr; /* # of strings in the file */
uint32_t str_longlen; /* length of longest string */
uint32_t str_shortlen; /* length of shortest string */
#define STR_RANDOM 0x1 /* randomized pointers */
#define STR_ORDERED 0x2 /* ordered pointers */
#define STR_ROTATED 0x4 /* rot-13'd text */
#define STR_COMMENTS 0x8 /* embedded comments */
uint32_t str_flags; /* bit field for flags */
char str_delim; /* delimiting character */
All fields are written in network byte order.
The purpose of unstr is to undo the work of strfile. It prints out the strings contained in the file source_file in the order that they are
listed in the header file source_file.dat to standard output. It is possible to create sorted versions of input files by using -o when
strfile is run and then using unstr to dump them out in the table order.
FILES
strfile.dat default output file.
SEE ALSO byteorder(3), fortune(6)HISTORY
The strfile utility first appeared in 4.4BSD.
BSD February 17, 2005 BSD