I have script to find the invalid character in file.
My valid.txt file is
But my script is not searching \ character which is string f='pallvi\mahajan'
Please let me know how i can do this.
I have run this script in debugging mode and it is running but this variable is not putting in file f.txt
while running script in debussgibg mode, i checked grep -sq is giving error when searching \
exit status is 2 in that time.
This attempts to run the command pallvi\mahajan and stores its output, if any, in f. Since no such command exists, you get nothing. I believe you meant:
Also, variables don't expand in single quotes. echo '$c' will print the literal text $c. I believe you meant echo "$c"
Also, some characters have a special meaning to grep. \ for example. To make grep take all characters you give it literally, tell it -F.
Also, you don't need to use $? to fit grep into an expression. Just use if ! grep ... then ...
Also, if you know your shell has [[ string == *str* ]], you could use it instead of grep. Or you could replace valid.txt and most of this program with one case, really.
The #1 mistake is the grep.
1. quote "$c"
2. a single \ is an RE error, must be \\
Because one can prepend a \ to a normal character, you can do
\\ is necessary for the shell; it will pass a single \ to grep.
You better use a non-RE grep
thanks but this did not work for another character getting backrefrence error
while running script in debug mode, i found this error and also this are passing another character also backslash
Posting "Does not work" without explanation does not help you or anyone. If a command does not work for you, please show the exact circumstances you used it, and the exact error or malfunction you received. Do not paraphrase errors, or post the text as links, images, or attachments if you can avoid it: Paste the exact message, in code tags, like [code] text [/code] or by selecting the text and using the button.
Hi Friend,
I have a client name list and client name has some invalid character due to which some issue raised and list of client are15k.
I want to make script who find invalid character name.
can you please help me how i can make script, i means i need logic.
Valid character are :-
... (5 Replies)
Hi,
i want find the character '-' in a file from position 284-298, if it occurs i need to replace it with 'O ' for the position in the file. How to do that using SED command.
thanks in advance,
Sara (9 Replies)
Hi Team,
i have 1st cloumn of data containing,
LAMSBA01-BA-COFF-YTD
LAMSBA01-BA-COFF-ITD
LAMSBA01-BA-AGGR-IND .
LAMSBA01-BA-CURR-COFF-BAL
i need to replace the "-" to "_" (underscore) using AWK .
please help me on this.
Thanks,
Baski (4 Replies)
While uploading an exl file to my application in Solaris 10 the upload failed with error Error! Parsing Error: /SPLM/TC83/tcdata83/model/model_dbextract.xml Line:65576 Column:73 An invalid XML character (Unicode: 0x1a) was found in the value of attribute "unitOfMeasureSymbol" and element is ... (12 Replies)
Hi All,
I am having a data file which consists of lakhs of records in the below foramt:
"1223323","4341341","discription aadfad"
"3123123","5463456","discription aadfad"
"2343324","6565767","discription asdfads"
"A3423423","7957456","discription aadfad"
"343453B","7957456","discription... (1 Reply)
Hi,
I am using a Perl script to generate a report file in Linux server. When my input data contains an invalid character which looks like hyphen after that my program is printing junk values in the report. Why that symbol is causing issue and is there a way to tell the server that this is a valid... (1 Reply)
Hi Experts,
Is there a way to find whether a file contains ^M character in it?. It's quite obvious to vi, but can this be accomplished using an automated way to find recursively in a directory.
probably i guess the best way would be to
1) Read the file and check if the end of line is ^M... (8 Replies)
Hi,
I have to write s script to check an input file for invalid characters. In this script I have to find the exact line of the invalid character. If the input file contain 2 invalid character sat line 10 and 17, the script will show the value 10 and 17. Any help is appreciated. (3 Replies)