Search Results

Search: Posts Made By: saj
1,288
Posted By saj
Splitting the file based on two fields - Fixed length file
Hi ,
I am having a scenario where I need to split the file based on two field values. The file is a fixed length file.
ex:
AA0998703000000000000190510095350019500010005101980301
K...
1,095
Posted By saj
Pivoting data based on a header field
Hi Team,

Could you please help me with the below scenario.

I have a file which is in the below format.

Zipcode,001,001f,002,002f,003,003f,004,004f,005,005f,006,006f,007,007f
0050, ,0, ,0,...
5,389
Posted By saj
Copying all the .sh files into a tar file
Hi All ,
I need to tar all the .sh files in a server along with the path .
Please let me know is there any way this can be accomplished .
Need to grep through all the directories and sub...
1,335
Posted By saj
Merging two files
Hi All ,

I have a scenario where we need to combine two files .
Below are the sample files and expected output ,

File 1:
1|ab
1|ac
1|ae
2|ad
2|ac

File 2:
1|xy
1|fc
2|gh
2|ku
...
787
Posted By saj
First zero is eliminating in the awk command
I am using something like this in my code

nawk 'BEGIN{OFS=FS="|"} {$15='$CalaMig'} {print}' filename

actually value of $CalaMig=01234

But its replacing as 1234 in the 15th postion.Its not...
1,703
Posted By saj
cat -n file | grep -w 2 | cut -d ":" -f2 | tr -d...
cat -n file | grep -w 2 | cut -d ":" -f2 | tr -d ' '|cut -d "=" -f2|sed 's/.*\(ORA-[0-9]*\).*/\1/p'

its working fine but the thing is that it is repeating twice '

ORA-00942
ORA-00942 like this
1,703
Posted By saj
Thanks a lot ..Its working fine. Also can...
Thanks a lot ..Its working fine.

Also can you please help me in ORA-00942(...) cutting this one to ORA-00942
1,703
Posted By saj
I tried some thing like this dsjob -logsum...
I tried some thing like this

dsjob -logsum -type WARNING -max 2 AvpnMgr Data_Consolidation_Engine_Part_2_Job2|grep "ORA"|awk '/ORA-/{match($0,/ORA-[0-9]/);print substr($0,RSTART);}'

Its not...
1,703
Posted By saj
Need to cut a some required data from file
Data_Consolidation_Engine_Part_2_Job2..TgtArBkt: ORA-00942: table or view does not exist

I have some thing like above in the file..

Upto this portion...
1,154
Posted By saj
I am using shell scripting
I am using shell scripting
1,154
Posted By saj
To view the log of a function
I have a function like this

validate()
{
/* Inside this I will do some activites
}


How I can redirect this function to a log file , so that If I look into that log file I can understand...
24,259
Posted By saj
Syntax Error
Thanks for the quick post ..But its giving me syntax error

awk: syntax error near line 1
awk: bailing out near line

---------- Post updated at 03:29 AM ---------- Previous update was at 03:24...
24,259
Posted By saj
How to Replace the value of a column using awk command?
Hi
cat test.txt

H|123|341|567|asfg
D|dfg|trtyy|errt
D|ert|frty|wer

Here I need to replace the third column value with 100 of the first record only and while printing I need to print the...
2,790
Posted By saj
Thanks Don ,It works , I have one more scenario...
Thanks Don ,It works , I have one more scenario where Key columns are not continuous.
Ex:
abc12345567hiabckd
abc12345567hiaipele
bcd23456890mkpele

when it comes in col1 and col3 which are...
2,790
Posted By saj
Please find the sample input file . ...
Please find the sample input file .
abc12345567hiabckd
abc12345567njipele
bcd23456890mkpele

Red colored is col1 and blue is col2

Sample output :
Duplicate file
abc12345567njipele

file...
2,790
Posted By saj
Removing duplicates in fixed width file which has multiple key columns
Hi All ,

I have a requirement where I need to remove duplicates from a fixed width file which has multiple key columns .Also , need to capture the duplicate records into another file .

File has...
16,897
Posted By saj
:) No not home work :) I am learning sed commands...
:) No not home work :) I am learning sed commands ..
16,897
Posted By saj
Thanks a lot Corona688 ... But is it possible to...
Thanks a lot Corona688 ... But is it possible to get a command in sed ..
I tired the below one .. but looks like some issue is there with the command ..

sed -n '/bbb/,+2p' filename
16,897
Posted By saj
Printing nth and n+1th line after a pattern match
Hi ,
I want to print the nth and n+1 lines from a file once it gets a pattern match.
For eg:

aaa
bbb
ccc
ddd
gh
jjjj

If I find a match for bbb then I need to print bbb as well as 3rd and...
5,021
Posted By saj
awk: record too long
Hi All ,
I am getting record too long for the below command .

nawk -F\" '{a[$1]=a[$1]" "$2} END{for(i in a) print i,a[i] }' test|sort|awk '{for(i=1;i<=NF;i++) t[i]=t[i]"\t"$i;if(NF>max)max=NF}...
2,165
Posted By saj
I am getting the error awk: syntax error...
I am getting the error

awk: syntax error near line 1
awk: bailing out near line 1
for the above command :(
2,165
Posted By saj
This is working as per the requirement , but is...
This is working as per the requirement , but is there a way to format the output .

For eg as of now im getting the output as below.
Name Prompt Default ParamType ParamLength...
2,165
Posted By saj
Pivot file content
Hi All ,
I have a file as below .
A "1"
B "2"
C "3"
D "4"
E "5"
F "6"
A "11"
B "21"
C "31"
D "41"
E "51"
F "61"

And the output should be like
A B C D E F
1 2 3 4 5 6
11 21 31 41 51
2,662
Posted By saj
Thanks a lot Scrutinizer :) It works...
Thanks a lot Scrutinizer :) It works !!!!!!!:b::)
2,662
Posted By saj
I am really sorry for not providing more info...
I am really sorry for not providing more info ....

Will the below example of the file help ..

If I will use the commands provided earlier it will return Name it self 4 times ..
While I need...
Showing results 1 to 25 of 31

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