Sponsored Content
Top Forums Shell Programming and Scripting To search distinct special char in file Post 302849923 by RudiC on Tuesday 3rd of September 2013 03:36:52 PM
Old 09-03-2013
Try this for non alnum chars in field 4:
Code:
sed -r 's/([^|]*\|){3}//;s/[[:alnum:]]*$//' file
$
#
$
=
=
#

EDIT: Or, if any position in field 4 is possible:
Code:
sed -r 's/([^|]*\|){3}//;s/^[[:alnum:]]*//;s/[[:alnum:]]*$//' file
$
#
$
=
=
#

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search special characters in a file

Hello I am new to shell scripting and can anyone tell me how to check if there are any special characters in a file. Can i use grep ? thanks susie (2 Replies)
Discussion started by: cramya80
2 Replies

2. UNIX for Advanced & Expert Users

Using egrep to search for Text and special char

Anyone is well-versed to use egrep to search a file for a line containing both: 1) AAA 2) $ I am having problem escaping the dollar sign when using egrep in conjunction with satisfying AAA as well. E.g. Text file Line 1 AAA Line 2 $$$ Line 3 AAA BBB $ Line 4 $$$ BBB AA will return me... (2 Replies)
Discussion started by: izy100
2 Replies

3. Shell Programming and Scripting

Special Char in Multiple Files

We develop a file in windows and move to unix box as a part of deployment. When we do this, we get ctrl-M(^M) character added to the file. So we need to remove ctrl-M(^M) character from all the files from deployment folder and all subfolders folder. Currently we move to individual folders and... (5 Replies)
Discussion started by: thinakarmani
5 Replies

4. UNIX for Dummies Questions & Answers

How to copy/move to a file with a special character as the 1st char in the filename?

I am trying to create files with special characters in its filenames for testing purposes. This is on a Linux RHEL4 but this should also be applicable on a Unix shell. I am able to create files with special characters in the filenames...e.g. cp -pv foo.gif \*special.gif cp -pv foo.gif \... (6 Replies)
Discussion started by: sqa777
6 Replies

5. Shell Programming and Scripting

Special Char in Data file

Hi All, I have a data file in UNIX which i am trying to load into Oracle table using Oracle SQL Loader. The problem is, one of the filed contains special character (ex: Square). And due to this reason, my script fails. Could you please let me know, how to identify which character is... (1 Reply)
Discussion started by: Amit.Sagpariya
1 Replies

6. Shell Programming and Scripting

Remove special char from end of the file

Hi I am working on a bash script and would know how to use cut or sed to remove (F/.M/d h) from a text file. Before 1 text to save (F/.M/d h) after 1 text to save Thanks in advance (5 Replies)
Discussion started by: pelle
5 Replies

7. Shell Programming and Scripting

Search distinct files

Hello , Can anyone help me with my below query I am trying to find a text in directory of files via below command grep -i cmps_cgs_crs_rfnc_id * But it returns multiple times same file name i.e if the text found in a file 4 times the file name shown 4 times in the o/p Is... (1 Reply)
Discussion started by: Pratik4891
1 Replies

8. Shell Programming and Scripting

Split a special char

Hello, I have some data in output file.In that i need to split the special char "(" and ")" and store it. This is example of o/p file. (OHC12345) (OHC12415) (OHC12765) (OHC12545) I need like OHC12345 OHC12415 OHC12765 OHC12545 --Thanks (5 Replies)
Discussion started by: rasingraj
5 Replies

9. Programming

Special char in a buffer

Hello, Please ,how can verify, if a case of buffer contains a special char ? (in C) Thank you. (3 Replies)
Discussion started by: chercheur857
3 Replies

10. Shell Programming and Scripting

To search null and char in file

Hi guys, I want to know how i can search null value and character value in a feed file. my file has Pipe delimted records. for eg: 1|12|xxx|yyy . . . N records I know the the which column null and char occurs does it has for eg 3rd column which i can obtain by awk $3 and (7 Replies)
Discussion started by: rohit_shinez
7 Replies
ISWALNUM(3)						     Linux Programmer's Manual						       ISWALNUM(3)

NAME
iswalnum - test for alphanumeric wide character SYNOPSIS
#include <wctype.h> int iswalnum(wint_t wc); DESCRIPTION
The iswalnum() function is the wide-character equivalent of the isalnum(3) function. It tests whether wc is a wide character belonging to the wide-character class "alnum". The wide-character class "alnum" is a subclass of the wide-character class "graph", and therefore also a subclass of the wide-character class "print". Being a subclass of the wide-character class "print", the wide-character class "alnum" is disjoint from the wide-character class "cntrl". Being a subclass of the wide-character class "graph", the wide-character class "alnum" is disjoint from the wide-character class "space" and its subclass "blank". The wide-character class "alnum" is disjoint from the wide-character class "punct". The wide-character class "alnum" is the union of the wide-character classes "alpha" and "digit". As such, it also contains the wide-char- acter class "xdigit". The wide-character class "alnum" always contains at least the letters 'A' to 'Z', 'a' to 'z' and the digits '0' to '9'. RETURN VALUE
The iswalnum() function returns nonzero if wc is a wide character belonging to the wide-character class "alnum". Otherwise, it returns zero. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +-----------+---------------+----------------+ |Interface | Attribute | Value | +-----------+---------------+----------------+ |iswalnum() | Thread safety | MT-Safe locale | +-----------+---------------+----------------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C99. NOTES
The behavior of iswalnum() depends on the LC_CTYPE category of the current locale. SEE ALSO
isalnum(3), iswctype(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2015-08-08 ISWALNUM(3)
All times are GMT -4. The time now is 07:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy