Search Results

Search: Posts Made By: Muthuraj K
6,205
Posted By Muthuraj K
search a string in a huge file
How to search a string which has occured numerous times in a single row. I tried many options, I am facing issue with the file size. Anything I go for, it says it is huge.. File is 82MB.

Assume,...
1,925
Posted By Muthuraj K
No it cannot be the 1st occurrence, it should be...
No it cannot be the 1st occurrence, it should be based on the comboination of the unique number in GS* row and the account number if RMR*. Read my first post for the details. Hope that will explain...
1,925
Posted By Muthuraj K
Of course, I replaced the 'file' with my actual...
Of course, I replaced the 'file' with my actual file name.

What I wanted is, that If the same account number is present in different GS-GE loops, then I should pick the exact loop which matches...
1,925
Posted By Muthuraj K
This is what I executed awk...
This is what I executed


awk 'BEGIN{RS="GS"} /RMR\*6121258075/ {print}' file | grep "6121258075"


---------- Post updated at 02:19 AM ---------- Previous update was at 02:16 AM ----------
...
1,925
Posted By Muthuraj K
Thanks for your response. It gives me the...
Thanks for your response.

It gives me the below error when I execute your command.


awk: Input line LADYS
RMR*IV*6025690 cannot be longer than 3,000 bytes.
The input line number is 98. The...
1,925
Posted By Muthuraj K
Position of the string in a complex file
I had a similar problem few days back and got this fixed with the below command when I have a file with this format


GS*12345*****
ST*1********
A*
B*
E*
RMR*123455(This is the unique number...
1,985
Posted By Muthuraj K
I tried something like this bnd=`awk...
I tried something like this

bnd=`awk '/^GS/{p=NR}$0~"^ABC.*\\*"k{f=1}/^GE/&&f{printf("%02f\n", p);f=0}' k="123213213213" FileName`


It gives me only one value, ideally, it shoud be giving 2...
1,985
Posted By Muthuraj K
Exponential issues
I have the below awk command to search a row and find the line number. It returns the value in exponential. I understand we can use the print "%.0f\n" to convert the exponential. I wanted to have...
1,114
Posted By Muthuraj K
SOLVED: Refining an awk command
I have a file (file1) with in the below format


ST*820*212121
BPR*C*213212.20*C*212*CCD*01***01*071000013*DA*321321*101208
TRN*1*21321321*13213
N1*PR*3232. dff. SYS.*91*3232
ENT*1
N1*PE*...
5,479
Posted By Muthuraj K
Hey Great!! It works. I am able to get the...
Hey Great!! It works. I am able to get the relevant loop numbers.

Thanks again

---------- Post updated at 05:07 AM ---------- Previous update was at 05:06 AM ----------

Can you explain this...
5,479
Posted By Muthuraj K
Yeah I do have the value in that as mentioned...
Yeah I do have the value in that as mentioned below. Even your latest code didnt get me any result.


GS*071000013*102562451P*101208*0503*443432*X*003050
ST*820*21321...
5,479
Posted By Muthuraj K
I am using HP-UX. The command I tried,...
I am using HP-UX.

The command I tried, where bs is the file name and 7203446151111 is teh unique number


awk '/^GS/{p=NR} $0~"^RMR\\*"k{f=1} /^GE/&&f{print p,NR;f=0}' k=7203446151111 bs
5,479
Posted By Muthuraj K
I tried both the snippet and it returns me...
I tried both the snippet and it returns me nothing..
5,479
Posted By Muthuraj K
Thanks for your response. I need to get the GS...
Thanks for your response. I need to get the GS and GE covering the RMR*12345

In my case, by having the unique number (12345) value, I wanted to fetch the GS just above the RMR and the GE below...
5,479
Posted By Muthuraj K
Find the position of lines matching string
I have a file with the below format,


GS*8*****
ST*1********
A*
B*
E*
RMR*123455(This is the unique number to locate this row)
F*
SE*1***
GE**
GS*9*****
ST*2
H*
J*
RMR*567889(This...
836
Posted By Muthuraj K
No it will not be identical. The data in B has to...
No it will not be identical. The data in B has to be replaced based on the looping on file A
836
Posted By Muthuraj K
Compare a file and insert
I have 2 files (A and B), Compare B with A and if the content matches based on a loop, overwrite those contents in A with B.

If B has something like below. The number '7658763276783' is an unique...
1,298
Posted By Muthuraj K
I have a group and have all users in that group....
I have a group and have all users in that group. However, there are few files created at run time and has issues with file permissions.

When I include this envPath.sh in my script, everything...
1,298
Posted By Muthuraj K
File permission
I have an application with the user mark and another user james is trying to run the application and ending up with file permission issues.

The user mark has set the umask as 002, I wanted to...
1,733
Posted By Muthuraj K
I forgot the command. I could get the result...
I forgot the command. I could get the result now...Thanks
1,733
Posted By Muthuraj K
how to organise a file
I have a file with only one record and the file size would be around 80 MB.

Is there a way, where I can read and write this to a file with only 80bytes in each row
3,473
Posted By Muthuraj K
Yessssss.. I got it.. Thanks a lot Franklin..
Yessssss.. I got it.. Thanks a lot Franklin..
3,473
Posted By Muthuraj K
Can I redirect the output of this to a file...
Can I redirect the output of this to a file something like


awk -F\* 'BEGIN{X="XXXXXXXXXX"}
/^BPR/{
n=length($10)-4
$10=substr(X,1,n) substr($10,n+1)
n=length($16)-4
$16=substr(X,1,n)...
3,473
Posted By Muthuraj K
I tried as per your comments by renaming my file...
I tried as per your comments by renaming my file to name.awk and called it from a shell by

sh $base/scripts/name.awk $InputFile


It gives me the below error


8754
8755
8756 ...
3,473
Posted By Muthuraj K
The logic behind this script is in my first post...
The logic behind this script is in my first post where I am trying to mask the 9th and 15th column in a BPR record.

This is all I have in my script as I have shown above. I am trying to call this...
Showing results 1 to 25 of 55

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