Note: The order in for (i in a) is arbitrary, so it cannot be used reliably to preserve order. An alternative would be to use a for(i=min;i<=max;i++) loop..
for example:
Hi,
I have several text files each containing some data as shown below:
File1.txt
>DataHeader
Data...
Data...
File2.txt
>DataHeader
Data...
Data...
etc.
What I want is to change the 'DataHeader' based on the file name. So the output should look like:
File1.txt
>File1
... (1 Reply)
Hi,
I need helping in finding some of the text in one file and some columns which have same column in file 1
EG
cat file_1
aaaa
bbbb
cccc
dddd
eeee
fffff
gggg
hhhh
cat file_2
aaaa,abcd,effgh,ereref,name,age,sex,...........
bbbb,efdfh,erere,afdafds,name,age,sex.............. (1 Reply)
Hi All,
I have some data like below.
Step1,Param1,Param2,Param3
1,2,3,4
2,3,4,5
2,4,5,6
3,0,1,2
3,0,0,0
3,2,1,3
........
so on
Where I need to find the median(arithmetic) of each column from Param1...to..Param3 for each set of Step1 values.
(Sort each specific column, if the... (5 Replies)
Hi All,
I want to remove the content based on the header information .
Please find the example below.
File1.txt
Name|Last|First|Location|DepId|Depname|DepLoc
naga|rr|tion|hyd|1|wer|opr
Nava|ra|tin|gen|2|wera|opra
I have to search for the DepId and remove the data from the... (5 Replies)
Hi All,
I need the modification for the below mentioned code (found in one more post https://www.unix.com/shell-programming-scripting/27161-script-generate-average-values.html) to find the average values for all the columns(but for a specific rows) and print the averages side by side.
I have... (4 Replies)
Hi,
I have two input files; file1 and file2. I compare them based on matched values in 1 column and print selected columns of the second file (file2). I got the result but the header was not printed. i want the header of file2 to be printed together with the result. Then i did below codes:-
... (3 Replies)
Hello,
I have some tab delimited text files with a three header rows. The headers look like, (sorry the tabs look so messy).
index group Name input input input input input input input input input input input... (9 Replies)
Hi Friends,
I have files with columns like this. This sample input below is partial.
Please check below for main file link. Each file will have only two rows.
... (8 Replies)
I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty.
I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)
Hi All,
i am trying to print required multiple columns dynamically from a fie.
But i am able to print only one column at a time.
i am new to shell script, please help me on this issue.
i am using below script
awk -v COLT=$1 '
NR==1 {
for (i=1; i<=NF; i++) {
... (2 Replies)
Discussion started by: balu1234
2 Replies
LEARN ABOUT HPUX
forder
forder(1) General Commands Manual forder(1)NAME
forder - convert file data order
SYNOPSIS
[file ...]
DESCRIPTION
The text orientation (mode) of a file can be right-to-left (non-Latin) or left-to-right (Latin). This text orientation can affect the way
data is arranged in the file. The data arrangements that result are called screen order and keyboard order. converts the order of charac-
ters in the file from screen order to keyboard order or vice versa.
reads the concatenation of input files (or standard input if none are given) and produces on standard output a converted version of its
input. If appears as an input file name, reads standard input at that point (use to delimit the end of options in such instances).
converts input files for all languages that are read from right-to-left. Unless the option is used, the command merely copies input files
to standard output for languages that are read from left-to-right.
Options
recognizes the following options:
Convert file data order for languages read from left-to-right.
Identify the file as having been created in Latin mode.
Identify the file as having been created in non-Latin mode.
EXTERNAL INFLUENCES
Environment Variables
The environment variable determines the mode and order of the file. The syntax of is:
[mode] [_order]
where mode describes the mode of a file: represents Latin mode, and represents non-Latin mode. Non-Latin mode is assumed for values other
than and The order describes the data order of a file: is keyboard, and is screen. Keyboard order is assumed for values other than and
Mode information in can be overridden from the command line.
The environment variable determines the direction of a language (left-to-right or right-to-left).
The environment variable determines whether a language has alternative numbers.
The environment variable determines the language in which messages are displayed.
International Code Set Support
Single-byte character code sets are supported.
EXAMPLES
The following command begins with file1, which exists in screen order, converts it to keyboard order, sorts the keyboard-ordered output,
converts it back to screen order, and redirects the output to file2. Note that is given to inform that file1 was created in non-Latin
mode.
WARNINGS
It is the user's responsibility to ensure that the environment variable accurately reflects the status of the file.
If present, alternative numbers always have a left-to-right orientation.
The command is HP proprietary, not portable to other vendors' systems, and will not be provided in future HP-UX releases.
AUTHOR
was developed by HP.
SEE ALSO environ(5), strord(3C), nljust(1).
forder(1)