09-11-2008
cat in linux, file holding special charcters
Hi
I'd like to cat, in linux, a file that holds special charcters, like "-->" and ">" and "]"
For example I have a file named test123.txt
it looks like this:
2008-09-11 00:27:01,496 -
< 0 > --> Start calculation of pattern [PROCESS_complex3], Pattern was split to [1] pattern graphs
< 0 > System Tqls Optimizer going to ask System Tqls results for all graph's elements except [-13]
< 16 > System Tqls Optimizer got System tqls results for [-11]
< 16 > Entered OverallPatternGraphCalculator witks [2] ; -15(-11 --> -13) - container_f ; -19(-11 --> -17) - container_f] calculation size [0 consistent=true]
< 16 > Entered ComponentGraphCalculator with component [Num of nodes [3] ; -17 - process ; -13 - disk ; -11 - host Num of links [2] ; -15(-11 --> -13) - container_f ; -19(-11 --> -17) - container_f, elements size 0] calculation size [0 consistent=true]
< 16 > Entered CompositeCalcul [2] ; -15(-11 --> -13) - container_f ; -19(-11 --> -17) - container_f, elements size 0] calculation size [0 consistent=true]
< 7500 > Calculation ended, result size [1769 consistent=false]
< 7500 > Calculation ended, result size [1769 consistent=false]
< 7500 > Entered ConsistencyChe- process ; -13 - disk ; -11 - host Num of links [2] ; -15(-11 --> -13) - container_f ; -19(-11 --> -17) - container_f] calculation size [1769 consistent=false]
< 7500 > Consistency at pattern level was found to be required due to previous calculation inconsistency
< 7516 > Calculation ended, result size [1769 consistent=false]
< 7516 > Calculation ended, result size [1769 consistent=false]
< 7516 > Result size [1769]
I want to cat it, the result should be:
< 0 > --> Start calculation of pattern [PROCESS_complex3], Pattern was split to [1] pattern graphs
< 7516 > Result size [1769]
I tried varations of the following command:
cat test123.txt | grep "> --> Start calculation of pattern [" | grep "> Result size ["
I tried it with one '
and with \ before the special chars etc...
Any Ideas ?
Thanks
9 More Discussions You Might Find Interesting
1. Solaris
Dear All,
I have created a UTF-8 database to store multi-lingual charcters. Below is the query from which i insert from Winsql (front-end third party database browser tool), the data gets inserted properly.
insert into a (no, lbl)
values (1, "Cliquez ici pour revenir Ã_ la recherche de... (2 Replies)
Discussion started by: lloydnwo
2 Replies
2. UNIX for Advanced & Expert Users
How do i remove single quotes(') from a file.
Can we use sed for it (2 Replies)
Discussion started by: kris01752
2 Replies
3. UNIX for Advanced & Expert Users
I have a csv file with a record size of greater than 2048.So when i try to open the file in VI..This is the error i get (test.csv" A line cannot be longer than 2048 characters)
Is there a way i can change this parameter to read a bigger line (2 Replies)
Discussion started by: kris01752
2 Replies
4. UNIX for Dummies Questions & Answers
Hi
Can anybody tell the difference between Difference between cat , cat > , cat >> and touch command in UNIX?
Thanks (6 Replies)
Discussion started by: skyineyes
6 Replies
5. UNIX for Advanced & Expert Users
I am trying to substitute a substring in a file and am having difficulty due to the presence of 'special characters'
I tried
sed -e "s/Bob's birthday 13/11/08 (today)/Bob's birthday 14/11/08 (tomorrow)/" file1
This does not action any change due to the square brackets.
How can I cater... (5 Replies)
Discussion started by: SAMZ
5 Replies
6. Shell Programming and Scripting
Hello,
So I sorted my file as I was supposed to:
sort -n -r -k 2 -k 1 file1 | uniq > file2
and when I wrote
> cat file2
in the command line, I got what I was expecting, but in the script itself
...
sort -n -r -k 2 -k 1 averages | uniq > temp
cat file2
It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies
7. UNIX for Dummies Questions & Answers
Find out lines in a given file consisting of the following pattern BCAA, BCAAA, BCAAAA, BCAAAAA, BCAAAAAA (0 Replies)
Discussion started by: Phaneendra G
0 Replies
8. Homework & Coursework Questions
find out lines in a given file consisting of the following pattern BCAA, BCAAA, BCAAAA, BCAAAAA, BCAAAAAA (1 Reply)
Discussion started by: Phaneendra G
1 Replies
9. Linux
I have a .CSV file when I check for the special characters in the file using the command cat -vet filename.csv, i get very lengthy lines with "^@", "^I^@" and "^@^M" characters in between each alphabet in all of the records. Using the code below file filename.csv I get the output as
I have a... (2 Replies)
Discussion started by: dhruuv369
2 Replies
CHSH(1) User Commands CHSH(1)
NAME
chsh - change your login shell
SYNOPSIS
chsh [-s shell] [-l] [-u] [-v] [username]
DESCRIPTION
chsh is used to change your login shell. If a shell is not given on the command line, chsh prompts for one.
chsh is used to change local entries only. Use ypchsh, lchsh or any other implementation for non-local entries.
OPTIONS
-s, --shell shell
Specify your login shell.
-l, --list-shells
Print the list of shells listed in /etc/shells and exit.
-u, --help
Print a usage message and exit.
-v, --version
Print version information and exit.
VALID SHELLS
chsh will accept the full pathname of any executable file on the system. However, it will issue a warning if the shell is not listed in
the /etc/shells file. On the other hand, it can also be configured such that it will only accept shells listed in this file, unless you
are root.
EXIT STATUS
Returns 0 if operation was successful, 1 if operation failed or command syntax was not valid.
SEE ALSO
login(1), passwd(5), shells(5)
AUTHOR
Salvatore Valente <svalente@mit.edu>
AVAILABILITY
The chsh command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux July 2009 CHSH(1)