Search Results

Search: Posts Made By: kshuser
3,077
Posted By kshuser
append end of line with 8 spaces
child_amt=$amount
prev_line="$prev_line $child_amt"

i am getting the result like this
21234567890001343 000001004OLFXXX029100020091112 0000060

but i want 8 spaces between the eg:...
2,971
Posted By kshuser
sed copy column value add to certain area
I have a base file FILE1 with the following data

FILE1.dat
21111111110001343 000001004OLFXXX029100020091112
21111111110000060 000001004ODL-CH001000020091112
22222222220000780...
9,937
Posted By kshuser
while read line do..
I have a base file FILE1 with the following data

FILE1.dat
21111111110001343 000001004OLF 029100020091112
21111111110000060 000001004ODL-CH001000020091112
22222222220000780 000001013OLF...
1,806
Posted By kshuser
Thanks all i used nawk and it works...
Thanks all
i used nawk and it works...
1,806
Posted By kshuser
Well i just used nawk but the outfile remain the...
Well i just used nawk but the outfile remain the same no change..

nawk 'BEGIN{FS=OFS=""}$31==" "{$31=$32=$33="X"}1' Infile.txt > friday.txt


I am using KSH.
1,806
Posted By kshuser
append each line on fixed position 31 to 33
I have a .DAT file like below.

26666666660001343 000001004OLF 029100020090820
27777777770000060 000001004ODL-CH001000020090820
28888888880000780 000001013OLF 006500020090820
.......
...........
2,207
Posted By kshuser
append + at of each line only if...
I am trying to append end of each line with positive sign +, only if the last line of the character is 0, eg in the file1 below the first record end of the line is negative sign(-), i do not want to...
2,158
Posted By kshuser
thanks danmero !! I am getting the following...
thanks danmero !!

I am getting the following error when i run your code
[CODE]>awk -F'[ |-]' '{$0=(NF==3)?$0 OFS f:((NF==2)?$0 OFS f OFS f:$0)}1' f="0000000" wedtest3_appnd_zero.txt
awk: syntax...
2,158
Posted By kshuser
append existing file with zeroes bsed on position
Hi i am trying to append value with 0 to an existing file in the position 50-56 & 58-64 only where empty space is there

Rule:
1 row already has some value and i do not want to change anything...
2,581
Posted By kshuser
thanks it works.. I also like to know i am...
thanks it works..

I also like to know i am getting some value into a variable using grep command
count_trlr=`grep "^3" $DATADIR/$FILE1.DAT| cut -c2-8`
After i get the value into variable i...
2,581
Posted By kshuser
i am getting syntax error as i want this in KSH...
i am getting syntax error as i want this in KSH script

>awk 'NF{c++;print} END{print (3000000 + c)}' ein_data_file.txt > ein_data_file1.dat
awk: syntax error near line 1
awk: bailing out near...
2,280
Posted By kshuser
append first line
I like to append the first line of a file with some value.

file1.dat


2111111111 23498ljljkj
2222222222 234kjkjs9
2333333333 98234lkjs
2444444444 0923skdfj


i want to append some...
2,581
Posted By kshuser
the no of records is not always the same. In the...
the no of records is not always the same. In the Input file there may be some more than 100 records we dont no...

BTW the above code has syntax error

>awk 'END{print $0,"\n""3000004"}1'...
2,581
Posted By kshuser
append last line
Suppose i have a file FILE1.TXT

2293847982374 sdj 23423
2298372038974 dsj 23492
2972837629376 abj 34929
2984836398384 abc 39723

I want to append the above FILE1.TXT with total no of records...
4,242
Posted By kshuser
Header as is.. trailer count
i have .DAT file FILE1.DAT

1200910270040625
2123456789 J123456 ABC
2123456789 K123456 ABC
2222222222 L123456 DEF
2333333333 M12345 GHI
30000004

My outfile FILE2.TXT should have like...
3,154
Posted By kshuser
In your awk code below where is the input file we...
In your awk code below where is the input file we are passing and where is outfile, i see "a" in your code is this the input file name....??? i also see word "file"..is this INPUT or OUTPUT file..??...
3,154
Posted By kshuser
But when i ran your code it is generating the...
But when i ran your code it is generating the outfile file but no changes compared to INPUT file.

>echo|cat FILE2.DAT -|while read line
> do
> case {$line:27:6} in
> ODL-SP|ODL-CH)
> prev+="...
3,154
Posted By kshuser
I am kind of new to KSH scripting. ...
I am kind of new to KSH scripting.

FILE1.DAT has the following records.

23666483030000653-B94030001ODL-Ch000000120081227
23797049900000654-E71060001OLFXXX000000220081227
23699281320000655...
3,154
Posted By kshuser
combine duplicate records
I have a .DAT file like below

23666483030000653-B94030001OLFXXX000000120081227
23797049900000654-E71060001OLFXXX000000220081227
23699281320000655 E71060002OLFXXX000000320081227...
6,545
Posted By kshuser
concatenate varaibles var1, var2 together to var1 again
HI

i like to concatenate the two variables
var1=$line (ie 22885068900000652 B86860003OLFXXX592123320081227)
var2=$amount (ie 123456)

i want to club together both the above varaible var1 &...
1,517
Posted By kshuser
Pls read my earlier posting on this. ...
Pls read my earlier posting on this.
https://www.unix.com/shell-programming-scripting/122011-while-read-line-do.html
1,517
Posted By kshuser
program in loop.
eg: sample.dat

21111111110000652 B86860003OLFXXX0000001_20081227
21111111110000652 B86860003ODL-SP0000002_20081227
21111111110000652-B94030001ODL-CH0000003_20081227...
2,356
Posted By kshuser
2,356
Posted By kshuser
while read line do
I have a .dat file like below eg: sample.DAT


21111111110000652 B86860003OLFXXX000000120081227
21111111110000652 B86860003ODL-SP000000220081227
21111111110000652-B94030001ODL-CH000000320081227...
45,320
Posted By kshuser
Thanks u so much cfajohnson !!!!!
Thanks u so much cfajohnson !!!!!
Showing results 1 to 25 of 30

 
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy