Search Results

Search: Posts Made By: kshuser
2,675
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,653
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,738
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,620
Posted By kshuser
Thanks all i used nawk and it works...
Thanks all
i used nawk and it works...
1,620
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,620
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,008
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...
1,792
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...
1,792
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,203
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,203
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,020
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,203
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,203
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...
3,568
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...
2,846
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..??...
2,846
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+="...
2,846
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...
2,846
Posted By kshuser
combine duplicate records
I have a .DAT file like below

23666483030000653-B94030001OLFXXX000000120081227
23797049900000654-E71060001OLFXXX000000220081227
23699281320000655 E71060002OLFXXX000000320081227...
5,271
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,334
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,334
Posted By kshuser
program in loop.
eg: sample.dat

21111111110000652 B86860003OLFXXX0000001_20081227
21111111110000652 B86860003ODL-SP0000002_20081227
21111111110000652-B94030001ODL-CH0000003_20081227...
2,163
Posted By kshuser
2,163
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...
39,107
Posted By kshuser
Thanks u so much cfajohnson !!!!!
Thanks u so much cfajohnson !!!!!
Showing results 1 to 25 of 30

 

Featured Tech Videos

All times are GMT -4. The time now is 07:48 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy