![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have a pattern that I need to search in a BIG file.
This is the command I am using Code:
awk '/EA2/ { print $0 }' filename
Code:
awk: 0602-561 There is not enough memory available now. The source line number is 1. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
I think all the records are in single line without the newline character.You can try fold command and awk it.
|
|
#3
|
|||
|
|||
|
Yes the file is a mainframe file so everything could be on one line. I tried this:
Code:
fold -w 150 filename | awk '/EA2/ { print $0 }'>/home/test/EA2.dat
|
|
#4
|
|||
|
|||
|
Check whether EA2 is there in the input file with the same case.
To maintain the format use this Code:
fold -w 150 filename | awk '/EA2/ { print $0 }'> tmp
tr -d '\n' tmp > /home/test/EA2.dat
|
|
#5
|
|||
|
|||
|
It works...I will check it out more and let you know if I face any problems.
Thanks a lot for your help! |
|||
| Google The UNIX and Linux Forums |