|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | 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 !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Exclude new line character while searching
Hi, I have a log file and want to search "0.48976360737438795" with excluding new line character. Currently i am using the following command: Code:
cat LogFile.log | tr -d '\n' | grep '0.48976360737438795' This command giving me the response if file size is small but if i am using a big file like in GB then it is not giving any response. I have attached the log file. Can anyone please help me on this? Last edited by vbe; 06-29-2012 at 09:02 AM.. Reason: code tags |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Hi Ankit,
can you show here your expected result? Regards, Dave Null |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
It should return everything whatever in the attached log file because my search string available in the every log step.
|
|
#4
|
||||
|
||||
|
Attachment ?? Also provide sample expected output ..
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
I'm not sure why you would want to display everything in your screen when the size of the file is in GB. Perhaps you can add "less" in your command, as it does not read the whole file before displaying. Code:
cat LogFile.log | tr -d '\n' | grep '0.48976360737438795' | less Last edited by vbe; 06-29-2012 at 09:03 AM.. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Once you remove all the text file line terminators the file is no longer a standard unix text file and is unsuitable for processing in unix shell tools.
What is the record format of the input file? Is is fixed length records or variable length records? A possible method might be to create two versions of the input file, one with every even numbered line terminator removed and one with every odd numbered line terminator removed. Then search both files to determine if the string is present. |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
I have attached the Input file and expected output file.
Please help me on this. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to remove new line character and append new line character in a file? | sasikari | HP-UX | 8 | 10-27-2010 06:09 PM |
| Searching a particular character in a file | gautamshaw | UNIX for Dummies Questions & Answers | 4 | 09-24-2010 05:26 PM |
| exclude a line | big123456 | Shell Programming and Scripting | 3 | 04-24-2008 12:31 PM |
| Searching a string for a character | turbulence | Shell Programming and Scripting | 7 | 01-12-2006 08:56 AM |
| searching for $ character | MizzGail | UNIX for Dummies Questions & Answers | 4 | 01-05-2006 10:21 PM |
|
|