Search Results

Search: Posts Made By: green_k
5,552
Posted By green_k
thanks R.Singh. The code works as expected. ...
thanks R.Singh. The code works as expected.

:b::b::b:
5,552
Posted By green_k
Thanks R.Singh. it works as expected. one more...
Thanks R.Singh. it works as expected.
one more question, I want to count total number of lines and put total number at end of the record. I don't know how to hold all the lines and print at end of...
5,552
Posted By green_k
thanks R.Singh. I tried to use awk to archive...
thanks R.Singh.
I tried to use awk to archive this, but it doesn't work as I have very limited knowledge.
below is my code. my thought is: first read section into ARRAY, then read next line; then...
5,552
Posted By green_k
How to change file section into each line?
Hi Gurus,
I have below file which has different sections, need to move the sections to beginning of the each record.
original file
[abc_xxxx_yyyy]
aaa
bbb
ccc
[abc_mmmm_nnnn]
ddd
eee
fff
...
9,952
Posted By green_k
How to assign awk values to shell variable?
Hi Gurus,
I have a script which assign awk output to shell variable. current it uses two awk command to assign value to two variables. I want to use one command to assign two values to two...
8,264
Posted By green_k
thanks for your explanation. I first though...
thanks for your explanation. I first though -F'[=\\][]' is multi delimiter too, but after run below command I lost.

:/apps >echo "[abcde]"|awk -F'[=\\][]' '{print NF}'
2
:/apps >echo...
8,264
Posted By green_k
Hi Chubler_XL, thanks for your answer. it works...
Hi Chubler_XL, thanks for your answer. it works fine. since I am relatively new for unix/awk scripting. I am not able to fully understand the code. below is my understanding about this code, some...
8,264
Posted By green_k
Hi Yoda, I modify this code to match multiple...
Hi Yoda,
I modify this code to match multiple pattern, it works fine. I have below question.
1. what's purpose of FS in this array. A[sc FS $1]. my understanding is when match find, then assign...
8,264
Posted By green_k
thanks Yoda for your quick response. the code...
thanks Yoda for your quick response. the code work with my sample data. it is my bad I didn't provide sample data correctly. the value1 , value2 and value3 don't have any relation. for example:...
8,264
Posted By green_k
A script need help
Hi Gurus,
I have below requirement and have no idea how to achieve this.
the input file like below. there are multiple sections in file, each section has multiple lines. I need to find certain...
4,871
Posted By green_k
Grep output to file result not as expected
Hi Gurus,
I run command grep ABC file1 > file2 against below file. I got all ABC_xxx in one line in file2. I expect to get multiple lines in file2. If I print result in screen, the result is...
2,436
Posted By green_k
Thanks.
Thanks.
2,436
Posted By green_k
ti works. thanks.
ti works. thanks.
2,436
Posted By green_k
Hi Gurus, I am able to use below command to get...
Hi Gurus,
I am able to use below command to get expected result. one more question:
I need to pass variable to this command, somehow it doesn't work.

awk -F"=" '!/ABCD/ {print $0}; /ABCD/...
2,436
Posted By green_k
thanks Scrutinizer. in the file, it has...
thanks Scrutinizer.

in the file, it has other contents which need to keep "as is". above command only print the match ones. how can I keep these file content as is.
for example:
old file:
...
2,436
Posted By green_k
thanks Scrutinizer. Sorry, I didn't give the...
thanks Scrutinizer. Sorry, I didn't give the sample properly. actually, there is only one value for all lines after equal. I updated my initial query. I tried to use awk command, I can use below...
2,436
Posted By green_k
How to replace part of string?
Hi Gurus,

I need to replace part of string in file, the string format is below: I can use ABCD to find string, then replace values after "=" sign

ABCD_XXX=value
ABCD_YYY=value
after replace...
1,932
Posted By green_k
How AS 400 sorting data?
Hi Gurus,
I have a requests to sort data based on AS 400 sorting order. below is example: the data is sorted by ascending order. could anybody explain how AS 400 sort data?

IMM00007
07918607...
3,361
Posted By green_k
thanks Don Cragun. the result is exactly I...
thanks Don Cragun.
the result is exactly I want.
sorry, I didn't explain my request more detail. you are right. actually, the whole line is identical if field #2 is identical.
My OS is...
3,361
Posted By green_k
Remove duplicated records and update last line record counts
Hi Gurus,

I need to remove duplicate line in file and update TRAILER (last line) record count. the file is comma delimited, field 2 is key to identify duplicated record.

I can use below command...
1,016
Posted By green_k
thanks bakunin and vgersh99. it is working now. I...
thanks bakunin and vgersh99. it is working now. I deleted the line . ${HOME}/.profile and re-type it. it works. before deleting, use cat -evt to check, there is no hiden characters. Not sure why.
...
1,016
Posted By green_k
thanks vgersh99 for you responding. when...
thanks vgersh99 for you responding.
when running script with ./script_name.ksh, it doesn't give anything.
initial script like below
#!/bin/ksh
. ${HOME}/.profile
if (( $# < 1 ))
then
echo...
1,016
Posted By green_k
Question about running script.
Hi Gurus,

I have problem to run script.
I can run script with command ksh script_name.ksh
but if i run script as ./script_name.ksh , it doesn't run. the permission for the script is:...
2,836
Posted By green_k
Thanks vgersh99. my current code is using cat...
Thanks vgersh99.
my current code is using cat command as you suggested. because file2 is really large file, so, it takes long time to run, I am wondering if there is better way to do it to get...
2,836
Posted By green_k
thanks vgersh99. Actually, it just add one line...
thanks vgersh99.
Actually, it just add one line (from file1) at begin of file2
in put file:
file1
this is first linefile2
abc
def
ghi
... the desired output is:
this is first line
abc
def...
Showing results 1 to 25 of 35

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