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

Quote:
Originally Posted by pravin27
I have created file of 1.5 GB with your data and some other information(junk data) and you can see the result below.

Code:
# du -h DCILog_DEBUG.csv.2010-12-21
1.5G    DCILog_DEBUG.csv.2010-12-21
# sed -n '/getBalanceWrapper/p' DCILog_DEBUG.csv.2010-12-21
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] getBalanceWrapper::getBalance:
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] getBalanceWrapper::getBalance:


See my output below:
File size is:
[sdpuser@gnnsdp40 test]$ ll -h DCILog_DEBUG.csv.2010-12-21
-rw-r--r-- 1 sdpuser sdpadmin 11G Dec 22 13:07 DCILog_DEBUG.csv.2010-12-21
Code:
[sdpuser@gnnsdp40 test]$ ll
total 21776828
-rw-r--r-- 1 sdpuser sdpadmin 11138823326 Dec 22 13:07 DCILog_DEBUG.csv.2010-12-21
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newaa
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newab
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newac
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newad
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newae
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newaf
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newag
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newah
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newai
-rw-r--r-- 1 sdpuser sdpadmin  1073741824 Jan 19 11:37 newaj
-rw-r--r-- 1 sdpuser sdpadmin   401405086 Jan 19 11:37 newak
[sdpuser@gnnsdp40 test]$ sed -n '/getBalanceWrapper/p' DCILog_DEBUG.csv.2010-12-21
[sdpuser@gnnsdp40 test]$

 

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
EXPAND_NUMBER(3)					   BSD Library Functions Manual 					  EXPAND_NUMBER(3)

NAME
expand_number -- format a number from human readable form LIBRARY
Utility functions from BSD systems (libbsd, -lbsd) SYNOPSIS
#include <bsd/libutil.h> int expand_number(const char *buf, uint64_t *num); DESCRIPTION
The expand_number() function unformats the buf string and stores a unsigned 64-bit quantity at address pointed out by the num argument. The expand_number() function follows the SI power of two convention. The prefixes are: Prefix Description Multiplier k kilo 1024 M mega 1048576 G giga 1073741824 T tera 1099511627776 P peta 1125899906842624 E exa 1152921504606846976 RETURN VALUES
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The expand_number() function will fail if: [EINVAL] The given string contains no digits. [EINVAL] An unrecognized prefix was given. [ERANGE] Result doesn't fit into 64 bits. SEE ALSO
humanize_number(3) HISTORY
The expand_number() function first appeared in FreeBSD 6.3. BSD
August 15, 2010 BSD
All times are GMT -4. The time now is 07:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy