10-10-2013
I have an array in which I would require original position of the value post sorting.
Below is simple script which I written using asort function to get the values sorted, but I need output as initial array original filed position after sorting.
-bash-3.2$ awk 'BEGIN {a[1]=1234; a[2]=14; a[3]=10; a[4]=12; a[5]=13; n=asort(a,dest); for (i=1;i<=n;i++) { printf("%s,", dest[i])}}'
10,12,13,14,1234,-bash-3.2$
-bash-3.2$
Excepted :
3,4,5,2,1
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have file format like below and I'm trying to modify this file.
I need to add 'ENDEND' end of each record.
01 ASH01 1CTCTL EDPPOO STAND
01 ASH08 0020 A1TH 101
01 ASH09 0022 A1TH 102
01 ASH09 0022 A1TH 103
01 ASH02 2CTCTL ... (5 Replies)
Discussion started by: naveenkcl
5 Replies
2. Shell Programming and Scripting
Hi,
I have a file that has data in it that says
00:01:48.233 1212
00:01:56.233 345
00:09:01.221 5678
00:12:23.321 93444
The file has more line than this but i just wanted to put in a snippet to ask how I would get the highest number with time stamp into another file. So from the above... (2 Replies)
Discussion started by: pat4519
2 Replies
3. Shell Programming and Scripting
Hi All,
I have a file that I would like to search for data and replace other data by record position number:
Example search..
search for "CLARK KENT" and replace Amt data "000025" with "000155"???
I'm able to search and replace unique data but, came to a stump when wanting to replace data... (11 Replies)
Discussion started by: macastor
11 Replies
4. UNIX for Dummies Questions & Answers
:EDIT:
I think my post name should have been labeled: how to copy files and record original file location. not "retain".
Hello, this is my first post! I searched the forums a lot before posting, but was unable to answer my question.
Here's my problem:
There are several hundred text files... (4 Replies)
Discussion started by: willie8605
4 Replies
5. Shell Programming and Scripting
Hello,
For the input file, I am trying to split those records which have multiple values seperated by '|' in the last input field, into multiple records and each record corresponds to the common input fields + one of the value from the last field.
I was trying with an example on this forum... (4 Replies)
Discussion started by: imtiaz99
4 Replies
6. Shell Programming and Scripting
Hi Experts,
I am new to shell scripting. Need some help in doing one task given by the customer.
The sample record in a file is as follows:
3538,,,,,,ID,ID1,,,,,,,,,,,
It needs to be the following:
3538,,353800,353800,,,ID,ID1,,,,,COLX,,,,,COLY,
And i want to modify this record in... (3 Replies)
Discussion started by: sugarcane
3 Replies
7. Shell Programming and Scripting
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
8. Shell Programming and Scripting
Hi Friends,
Below is my input file with "|" (pipe) as filed delimiter:
My Input File:
HDR|F1|F2||||F6|F7
I want to inser values in the record for field 4 and field 5.
Expected output
HDR|F1|F2||F4|F5|F6|F7
I am able to append the string to the end of the record, but not in between the... (3 Replies)
Discussion started by: Ajay Venkatesan
3 Replies
9. Shell Programming and Scripting
Table
ACN|NAME|CITY|CTY|NO1|NO2
115|AKKK|ASH|IND|10|15
115|AKKK|ASH|IND|20|20
115|AKKK|ASH|IND|30|35
115|AKKK|ASH|IND|30|35
112|ABC|FL|USA|15|15
112|ABC|FL|USA|25|20
112|ABC|FL|USA|25|45
i have written shell script using cut command
and awk programming getting error correct it and add... (5 Replies)
Discussion started by: udhal
5 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I have a file and it is a fixed length file. I want to move the values from 42,6 ( where 6 is length) to the 36th position
Original file:
00000100000100000100000100000100001 000870 ... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
LEARN ABOUT ULTRIX
dwtscrollbargetslider
DwtScrollBarGetSlider(3Dwt) DwtScrollBarGetSlider(3Dwt)
Name
DwtScrollBarGetSlider - Retrieves the current size and position parameters of the slider in the scroll bar widget.
Syntax
void DwtScrollBarGetSlider(widget, value_return, shown_return,
inc_return, pageinc_return)
Widget widget;
int *value_return;
int *shown_return;
int *inc_return;
int *pageinc_return;
Arguments
widget Specifies the scroll bar widget ID.
value_return
Returns the scroll bar's top thumb (slider) position between the DwtNminValue and DwtNmaxValue attributes to the scroll bar wid-
get.
shown_return
Returns the size of the slider as a value between zero and the absolute value of DwtNmaxValue minus DwtNminValue. The size of
the slider varies, depending on how much of the slider scroll area it represents.
inc_return
Returns the amount of button increment and decrement.
pageinc_return
Returns the amount of page increment and decrement.
Description
The DwtScrollBarGetSlider function returns the currently displayed size/position values of the slider in the scroll bar widget. The scroll
region is overlaid with a slider bar that is adjusted in size and position using the main scroll bar or set slider function attributes.
The stepping arrows and the slider are the scroll activator objects providing the user interface syntax ``feel.''
See Also
DwtScrollBarSetSlider(3Dwt)
Guide to the XUI Toolkit: C Language Binding
Guide to the XUI Toolkit Intrinsics: C Language Binding
DwtScrollBarGetSlider(3Dwt)