06-26-2009
Multi record
I have fixed width source file data look like this,
J510111112222
J5102ABCD
J510133334444
J5102EFGH
I want to make this like
11112222J510111112222
11112222J5102ABCD
33334444J510133334444
33334444J5102EFGH
Bolded is the record type.
Thanks for help.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Good day!
I am trying to learn how to use the "sed" editor, to perform multiple edits on multiple files in multiple directories.
I have one script that tries to call up each file and process it according to the edits listed in a second script. I am using a small input text to test these, at... (12 Replies)
Discussion started by: kielitaide
12 Replies
2. UNIX for Dummies Questions & Answers
Dear Experts
Why we always hear that unix operating system is Multi User and Multi task. What does these two means. I have looked at some books and documents but couldn't find aclear explenation. Can we say Windows operating system is also multi user and multi task??
Thanks for your help in... (6 Replies)
Discussion started by: Reza Nazarian
6 Replies
3. Shell Programming and Scripting
I have a fixed width source file like this( it has 5 different record types identified by bolded numbers)
N5101ABCD 9820398 2983287
N5102 9s9923 00000000 00
N5103
N5101TTT 9843438 9494994
N5104 sdsd
N5101YYY 7777777 1111111
I need to have like this:
N5101ABCD ... (2 Replies)
Discussion started by: saravanamr
2 Replies
4. Shell Programming and Scripting
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
The output should be
1one
2two
3three
1four
2five
3six (2 Replies)
Discussion started by: supchand
2 Replies
5. Shell Programming and Scripting
Hi,
I have a problem where I need to make this input:
nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a
nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b
look like this output:
nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies
6. Shell Programming and Scripting
Hi! all
can any one tell me how to compare current record of column with next and previous record in awk without using array
my case is like this
input.txt
0 32
1 26
2 27
3 34
4 26
5 25
6 24
9 23
0 32
1 28
2 15
3 26
4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies
7. Shell Programming and Scripting
I have test.xml
<emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp>
<Join><id>101</id><city>london</city><date>06/06/14 2011</date></join>
<Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join>
<Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies
8. Programming
I am trying to write a large X app. I have successfully modified my xorg.conf to setup 4 monitors on an NVIDIA Quatro5200. I am trying to modify a simple hello world application to open a window on three of the four monitors. depending on the changes to loop the window creation section and event... (2 Replies)
Discussion started by: advorak
2 Replies
9. Shell Programming and Scripting
Hi,,
I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows..
SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Discussion started by: Samah
1 Replies
10. Shell Programming and Scripting
Input File:
>Seq1
ASDADAFASFASFADGSDGFSDFSDFSDFSDFSDFSDFSDFSDFSDFSDFSD
>Seq2
SDASDAQEQWEQeqAdfaasd
>Seq3
ASDSALGHIUDFJANCAGPATHLACJHPAUTYNJKG
......
Desired Output File
>Seq1
ASDADAFASF
ASFADGSDGF
SDFSDFSDFS
DFSDFSDFSD
FSDFSDFSDF
SD
>Seq2 (4 Replies)
Discussion started by: patrick87
4 Replies
LEARN ABOUT CENTOS
pmnumberstr
PMNUMBERSTR(3) Library Functions Manual PMNUMBERSTR(3)
NAME
pmNumberStr, pmNumberStr_r - fixed width output format for numbers
C SYNOPSIS
#include <pcp/pmapi.h>
const char *pmNumberStr(double value);
char *pmNumberStr_r(double value, char *buf, int buflen);
cc ... -lpcp
DESCRIPTION
pmNumberStr returns the address of a 8-byte buffer that holds a null-byte terminated representation of value suitable for output with fixed
width fields. The pmNumberStr_r function does the same, but stores the result in a user-supplied buffer buf of length buflen, which should
have room for at least 8 bytes.
The value is scaled using multipliers in powers of ``one thousand'' (the decimal ``kilo'') and has a bias that provides greater precision
for positive numbers as opposed to negative numbers.
The format depends on the sign and magnitude of value as follows (d represents a decimal digit):
+----------------------------------+---------+
| value range | format |
+----------------------------------+---------+
| > 999995000000000 | inf? |
|999995000000000 - 999995000000 | ddd.ddT |
| 999995000000 - 999995000 | ddd.ddG |
| 999995000 - 999995 | ddd.ddM |
| 999995 - 999.995 | ddd.ddK |
| 999.995 - 0.005 | ddd.dd |
| 0.005 - -0.005 | 0.00 |
| -0.005 - -99.95 | -dd.dd |
| -99.995 - -99995 | -dd.ddK |
| -99995 - -99995000 | -dd.ddM |
| -99995000 - -99995000000 | -dd.ddG |
| -99995000000 - -99995000000000 | -dd.ddT |
| < -99995000000000 | -inf? |
+----------------------------------+---------+
At the boundary points of the ranges, the chosen format will retain the maximum number of significant digits.
NOTES
pmNumberStr returns a pointer to a static buffer and hence is not thread-safe. Multi-threaded applications should use pmNumberStr_r
instead.
SEE ALSO
printf(3)
Performance Co-Pilot PCP PMNUMBERSTR(3)