one of my colleagues has this question.
he has a command, C_CMD which accepts 4 variables, $1 $2 $3 $4
he wants to load up a file with multiple rows, one row per set of variables and then iteratively execute the command based on the content of the file.
example:
at the command line you'd... (5 Replies)
Hi,
I needs to split *.txt files from single directory depends on the some mutltiple input values. i have wrote the code like below
for file in *.txt
do
grep -i -h "value1|value2" $file > $file;
done.
My requirment is more input values needs to be given in grep; let us say 50... (3 Replies)
I have a file that logs multiple sessions. What I would like to do is split this file inclusive of the lines that include "starting session" and "shutting down" and ignore the data before and after the beginning of the first session and the end of the last session. The output files can be called... (2 Replies)
To split the files
Hi,
I'm having a xml file with multiple xml header. so i want to split the file into multiple files.
Test.xml
---------
<?xml version="UTF_8">
<emp: ....>
<name>a</name>
<age>10</age>
</emp>
<?xml version="UTF_8">
<emp: ....>
<name>b</name>
<age>10</age>... (11 Replies)
I need to write a shell script for below scenario
My input file has data in format:
qwerty0101TWE 12345 01022005 01022005 datainala alanfernanded 26
qwerty0101mXZ 12349 01022005 06022008 datainalb johngalilo 28
qwerty0101TWE 12342 01022005 07022009 datainalc hitalbert 43
qwerty0101CFG 12345... (19 Replies)
Hi,
I have a space delimited text file with multiple columns 102 columns. I want to break it up into 100 files labelled 1.txt through 100.txt (n.txt). Each text file will contain the first two columns and in addition the nth column (that corresponds to n.txt). The third file will contain the... (1 Reply)
Hi All,
I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd.
What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
Hi Friends ,
Please guide me with the code to extract multiple files from one file .
The File Looks like ( Suppose a file has 2 tables list ,column length may vary )
H..- > File Header....
H....- >Table 1 Header....
D....- > Table 1 Data....
T....- >Table 1 Trailer....
H..-> Table 2... (1 Reply)
Hi all,
Newbie here. First of all, sorry if I made any mistakes while posting this question in terms of rules. Correct me if I am wrong. :b:
I have a .dat file whose name is in the format of 20170311_abc_xyz.dat. The file consists of records whose first column consists of multiple dates in... (2 Replies)
Hello I have a file of following format
HDR 1234 abc qwerty
abc def ghi jkl
HDR 4567 xyz qwerty
abc def ghi jkl
HDR 890 mno qwerty
abc def ghi jkl
HDR 1234 abc qwerty
abc def ghi jkl
HDR 1234 abc qwerty
abc def ghi jkl
-Need to split this into multiple files based on tag... (8 Replies)
Discussion started by: wincrazy
8 Replies
LEARN ABOUT HPUX
uniq
uniq(1) General Commands Manual uniq(1)NAME
uniq - report repeated lines in a file
SYNOPSIS
fields] chars] [input_file [output_file]]
DESCRIPTION
reads the input text file input_file, comparing adjacent lines, and copies the result to output_file. If input_file is not specified, the
standard input and standard output are used. If input_file is specified, but output_file is not, results are printed to standard output.
input_file and output_file must not be the same file.
Line-Comparison Options
recognizes the following options when comparing adjacent lines:
Print those lines that are repeated in the original file.
Print copy only of each repeated line in the input file.
Generate an output report in default style
except that each line is preceded by a count of the number of times it occurred. If this option is specified, the and
options are ignored if either or both are also present.
If none of the options or are present, prints the results of the union of the and options, producing a copy of the original input file with
the second and succeeding copies of any repeated lines removed. (Note that repeated lines must be adjacent in order to be found -- see
sort(1)).
Field-Skip Options
Two options are provided for skipping an initial portion of each line when making comparisons:
Ignore the first
fields fields, together with any blanks before each. fields is a positive decimal integer. A field is defined as a
string of non-space, non-tab characters separated by tabs and/or spaces from its neighbors.
Ignore the first
chars characters. chars is a positive decimal integer. Each line in the input is assumed to be terminated with a
new line character for purposes of comparison. Fields are skipped before characters.
EXTERNAL INFLUENCES
Environment Variables
must be equal to the value it had when the input files were sorted.
determines the interpretation of text within files as single- and/or multi-byte characters, and defines a space character when the or
option is used.
determines the language in which messages are displayed.
If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty
variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization
variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
Exit values are:
0 Successful completion.
>0 Error condition occurred.
AUTHOR
was developed by OSF and HP.
SEE ALSO comm(1), sort(1).
STANDARDS CONFORMANCE uniq(1)