Sponsored Content
Top Forums Shell Programming and Scripting Getting Segmention fault error while searching string in csv file Post 302488956 by poweroflinux on Wednesday 19th of January 2011 01:34:08 AM
Old 01-19-2011
Question Reply to Pravin27

Quote:
Originally Posted by pravin27
Try this,
sed can process data rather quickly. It can handle large files well.
Code:
sed -n '/<pattern>/p' datafile

Hi Pravin,

No output received using the above command.
Following shows for your reference:
Code:
[sdpuser@gnnsdp40 test]$ tail -f DCILog_DEBUG.csv.2010-12-21
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] ******
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] getBalanceWrapper::getBalance:
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] Inside parsing Balance Buckets-[2;, 1;, 27;]
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] Current Bucket Lookedup  :1;
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] Current Bucket Lookedup  :13;
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] Current Bucket Lookedup  :20;
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] Current Bucket Lookedup  :24;
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] Parse Bucket Details-->{1;=20.50, STR_BUCKET_TOTAL=20.50}
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] Bucket details after summation : 1;20091003;20110619;20.50;|13;20101210;20110109;102400.00;|20;20101210;20110109;99854.00;|24;20101208;20110107;334.00;|
21 Dec 2010 23:59:59,760 INFO  -  [dci_plugin_InstanceOne#wlng_nt_payment_dci#1.0] the balance bucket is : 1;20091003;20110619;20.50;|13;20101210;20110109;102400.00;|20;20101210;20110109;99854.00;|24;20101208;20110107;334.00;|

[sdpuser@gnnsdp40 test]$
[sdpuser@gnnsdp40 test]$ sed -n '/getBalanceWrapper/p' DCILog_DEBUG.csv.2010-12-21
[sdpuser@gnnsdp40 test]$ sed -n '/Parse/p' DCILog_DEBUG.csv.2010-12-21
[sdpuser@gnnsdp40 test]$ sed -n '/8858406465/p' DCILog_DEBUG.csv.2010-12-21

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

searching for a string though file system

Is there a way to search an entire file system for the occurance of a string..... other than grep. I have a large directory structure and I'm not certain that grep <string> */*/*/*... is all that effective - especially as I can't be sure of the number of levels to go down without heaps of... (3 Replies)
Discussion started by: peter.herlihy
3 Replies

2. Shell Programming and Scripting

Perl: searching for a string in a file...

Hi All, I need to search for a string in a file that I've opened and base a decision on the result. The logic is this: "if the word 'Shared' appears on the first line then do this on the whole file else do this on the whole file " The code I currently have isn't working:... (4 Replies)
Discussion started by: pondlife
4 Replies

3. Shell Programming and Scripting

Extracting a string from one file and searching the same string in other files

Hi, Need to extract a string from one file and search the same in other files. Ex: I have file1 of hundred lines with no delimiters not even space. I have 3 more files. I should get 1 to 10 characters say substring from each line of file1 and search that string in rest of the files and get... (1 Reply)
Discussion started by: mohancrr
1 Replies

4. UNIX for Dummies Questions & Answers

searching for a string in a file

I need to search for a specific string in a file and if this string exist I need to replace it with something else. I am not sure how I could do this, using an if statement. (2 Replies)
Discussion started by: ROOZ
2 Replies

5. Shell Programming and Scripting

Searching a string in a file

Hi, I am new to unix shell scripting. I have a requirement. Could anyone help me writing the script for the same? Here goes the requirement: I have a config file let's say temp.config. Here is the data in the config file temp.config : ------------- name=victor age=42 state=texas... (5 Replies)
Discussion started by: badrimohanty
5 Replies

6. Shell Programming and Scripting

searching each file for a string

Hi Guys... I want to search for each file that contains a particular string. e.g find . -print | xargs grep -i string_name Now my issue is the files that I search in are gzipped. Will I be able to find the string, using the above commands, even if the files are gzipped? Please... (2 Replies)
Discussion started by: Phuti
2 Replies

7. Shell Programming and Scripting

Searching for a specific string in a file

Hi I am trying to search for a certain set of patterns within a file, and then perform other commands based on output. testfile contents: password requisite pam_cracklib.so lcredit=-1 ucredit=-1 ocredit=-1 script: D="dcredit=-1" if then echo $D exists else echo $D doesnt... (8 Replies)
Discussion started by: bludhemn
8 Replies

8. Shell Programming and Scripting

Searching a string stored in other file

I need to design a script which can do the following: I have two files abc.txt and constant.hmtl abc.txt contains some 5 string that I need to see if they exist in contants.html. Constants.hmtl is a very large file around 800 lines. I want to search all the strings present in file... (8 Replies)
Discussion started by: hemasid
8 Replies

9. Shell Programming and Scripting

Searching a string in a particular file name

Hello, I have a file name like FIRST_DPF_DAILY_CUST_0826152322.txt i need to extract the string after the third "_" underscore upto timestamp ends i.e CUST_0826152322 can anyone help me with the code Thank you! Regards Srikanth Sagi (3 Replies)
Discussion started by: srikanth_sagi
3 Replies

10. Shell Programming and Scripting

Removing string from CSV file by provide removal string from other file

What I need is to remove the text from Location_file.txt from each line matching all entries from Remove_location.txt Location_file.txt FlowPrePaid, h3nmg1cm2,Jamaica_MTAImageFileFlowPrePaid,h0nmg1cm1, Flow_BeatTest,FlowRockTest FlowNewTest,FlowNewTest,h0nmg1cm1 PartiallySubscribed,... (3 Replies)
Discussion started by: ketanraut
3 Replies
fmd(1M)                                                   System Administration Commands                                                   fmd(1M)

NAME
fmd - fault manager daemon SYNOPSIS
/usr/lib/fm/fmd/fmd [-V] [-f file] [-o opt=val] [-R dir] DESCRIPTION
fmd is a daemon that runs in the background on each Solaris system. fmd receives telemetry information relating to problems detected by the system software, diagnoses these problems, and initiates proactive self-healing activities such as disabling faulty components. When appropriate, the fault manager also sends a message to the syslogd(1M) service to notify an administrator that a problem has been detected. The message directs administrators to a knowledge article on Sun's web site, http://www.sun.com/msg/, which explains more about the problem impact and appropriate responses. Each problem diagnosed by the fault manager is assigned a Universal Unique Identifier (UUID). The UUID uniquely identifes this particular problem across any set of systems. The fmdump(1M) utility can be used to view the list of problems diagnosed by the fault manager, along with their UUIDs and knowledge article message identifiers. The fmadm(1M) utility can be used to view the resources on the system believed to be faulty. The fmstat(1M) utility can be used to report statistics kept by the fault manager. The fault manager is started automatically when Solaris boots, so it is not necessary to use the fmd command directly. Sun's web site explains more about what capabilities are cur- rently available for the fault manager on Solaris. OPTIONS
The following options are supported -f file Read the specified configuration file prior to searching for any of the default fault manager configuration files. -o opt=value Set the specified fault manager option to the specified value. Fault manager options are currently a Private inter- face; see attributes(5) for information about Private interfaces. -R dir Use the specified root directory for all pathnames evaluated by the fault manager, instead of the default root (/). -V Print the fault manager's version to stdout and exit. EXIT STATUS
The following exit values are returned: 0 Successful completion 1 An error occurred which prevented the fault manager from initializing, such as failure to open the telemetry trans- port. 2 Invalid command-line options were specified. FILES
/etc/fm/fmd Fault manager configuration directory /usr/lib/fm/fmd Fault manager library directory /var/fm/fmd Fault manager log directory ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWfmd | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
svcs(1), fmadm(1M), fmdump(1M), fmstat(1M), syslogd(1M), attributes(5), smf(5) http://www.sun.com/msg/ NOTES
The Fault Manager is managed by the service management facility, smf(5), under the service identifier: svc:/system/fmd:default The service's status can be queried using the svcs(1) command. Administrators should not disable the Fault Manager service. SunOS 5.10 17 Nov 2004 fmd(1M)
All times are GMT -4. The time now is 04:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy