Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to use grep: finding a string with double quotes and multiple digits Post 302488565 by Chubler_XL on Monday 17th of January 2011 06:08:34 PM
Old 01-17-2011
If your grep supports -E (extended regex) then you can use
Code:
grep -E '"[0-9]{10}"' datafile

If not you will just have to repeat the char list 10 times:
Code:
gerp '"[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"' datafile

If this is matching what you want, use the grep -v option to print all lines but those that match (in effect deleting the matching lines).
This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace multiple blanks within double quotes

I have various column names within double quotes, separated by commas. Example: "column one", "column number two", "this is column number three", anothercolumn, yetanothercolumn I need to eliminate the double quotes and replace the blanks within the double quotes by underscores, giving: ... (5 Replies)
Discussion started by: jgrogan
5 Replies

2. Shell Programming and Scripting

Add double quotes around the string

I have a line in multiple scripts:select into table /dir1/dir2/file.dat dir1 and dir2 are the same but file.dat is different from script to script. I need to include /dir1/dir2/file.dat into double quotes in each file of my directory:select into table "/dir1/dir2/file.dat" (13 Replies)
Discussion started by: surfer515
13 Replies

3. Emergency UNIX and Linux Support

Grep expression between double quotes

I need a quick expression to be able to pull out all the data in a text file that looks like "http:// some random url etc" So it should grab any string that begins with "http:// and ends with " There are other double quotes in the file but I only want the ones that start with "http:// and the... (31 Replies)
Discussion started by: glev2005
31 Replies

4. UNIX for Dummies Questions & Answers

grep single quotes or double quotes

Unix superusers, I am new to unix but would like to learn more about grep. I am very familiar with regular expressions as i have used them for searching text files in windows based text editors. Since I am not very familiar with Unix, I dont understand when one should use GREP with the... (2 Replies)
Discussion started by: george_vandelet
2 Replies

5. Shell Programming and Scripting

Multiple double quotes

hi Need to run below command on remote server: cmd -a "1 2" -b 3 If i run below, there's clash matching double quotes and fail. ssh $server "cmd -a "1 2" -b 3" I have few ideas which worked (like keeping the entire cmd in a file and copy it to remote server and then run that file)... (1 Reply)
Discussion started by: reddyr
1 Replies

6. Shell Programming and Scripting

How to find a string with double quotes?

I have thousands of files in a directory. I need to find/list all files that have the below matching string - RETURNCODE: "1017" Thank you! (5 Replies)
Discussion started by: esmgr
5 Replies

7. Shell Programming and Scripting

Replace double quotes with a single quote within a double quoted string

Hi Froum. I have tried in vain to find a solution for this problem - I'm trying to replace any double quotes within a quoted string with a single quote, leaving everything else as is. I have the following data: Before: ... (32 Replies)
Discussion started by: pchang
32 Replies

8. Shell Programming and Scripting

Adding double quotes at the end of string

My input is this: Inputfile = file.txt needs to change to, Inputfile = file.txt" I have tried using: Inputfile = `echo ${Inputfile}"' doesn't work for me. Similarly how do I change it to all double quotes: Inputfile = "file.txt" (4 Replies)
Discussion started by: bvnprasad123
4 Replies

9. Shell Programming and Scripting

Replace Double quotes within double quotes in a column with space while loading a CSV file

Hi All, I'm unable to load the data using sql loader where there are double quotes within the double quotes As these are optionally enclosed by double quotes. Sample Data : "221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22" Refurbished - Airwave","Supply... (6 Replies)
Discussion started by: mlavanya
6 Replies

10. Shell Programming and Scripting

Removal of multiple characters with in double quotes

For one of my need I was going through post "Removal of new line character in double quotes" Which alister has replied like $ cat data "leave me alone" "ABCD RENT-A- CAR XYZ LTD","00N0H","Enterprise Lake"," 100 View Way" $ sed -n 'H;g;/^*"*\("*"*\)*$/d; s/^\n//; y/\n/ /; p; s/.*//; h'... (9 Replies)
Discussion started by: Jag_1981
9 Replies
CTYPE_ALNUM(3)								 1							    CTYPE_ALNUM(3)

ctype_alnum - Check for alphanumeric character(s)

SYNOPSIS
bool ctype_alnum (string $text) DESCRIPTION
Checks if all of the characters in the provided string, $text, are alphanumeric. PARAMETERS
o $text - The tested string. RETURN VALUES
Returns TRUE if every character in $text is either a letter or a digit, FALSE otherwise. EXAMPLES
Example #1 A ctype_alnum(3) example (using the default locale) <?php $strings = array('AbCd1zyZ9', 'foo!#$bar'); foreach ($strings as $testcase) { if (ctype_alnum($testcase)) { echo "The string $testcase consists of all letters or digits. "; } else { echo "The string $testcase does not consist of all letters or digits. "; } } ?> The above example will output: The string AbCd1zyZ9 consists of all letters or digits. The string foo!#$bar does not consist of all letters or digits. NOTES
Note If an integer between -128 and 255 inclusive is provided, it is interpreted as the ASCII value of a single character (negative val- ues have 256 added in order to allow characters in the Extended ASCII range). Any other integer is interpreted as a string contain- ing the decimal digits of the integer. SEE ALSO
ctype_alpha(3), ctype_digit(3), setlocale(3). PHP Documentation Group CTYPE_ALNUM(3)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy