06-28-2010
Thanks for the response worked well. What type of chacter identification is \x27?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Can someone let me know how I can acheive the following.
I have ~ delimited file and I need to convert into something like SQL insert statements.
SrcFile :
1~sjdsdj~asasas~
2~aaaaa~qwqwqwq~qwq
.....
I tried
AWK -F"~" '{print "INSERT INTO XX VALUES("$1 " ,\' "$2" \' , \' "$3 }'... (3 Replies)
Discussion started by: braindrain
3 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
It is a very stupid problem but I am not able to find a solution to it.
I am using awk to get a column from a file and I want to get the output field in between single quotes. For example,
Input.txt
123 abc
321 ddff
433 dfg
........
I want output file to be as
... (6 Replies)
Discussion started by: gauravgoel
6 Replies
3. Shell Programming and Scripting
i want to print ' symbol using awk i tried:
awk '{print " ' "}'
awk '{print "\' "}'
both not work please help me. (2 Replies)
Discussion started by: RahulJoshi
2 Replies
4. Shell Programming and Scripting
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies
5. Shell Programming and Scripting
cat a | awk -F";" '{print "update db set column=' "$2" ' where column1=\""$1"\";"}' > ip-add.sql
Hi! I'm a new user!
i need to use single quote in the double quotes print string
The apex between che "$2" should not be interpreted, but....how?!
I'm trying to use \ but don't work correctly!
... (4 Replies)
Discussion started by: Re DeL SiLeNziO
4 Replies
6. Shell Programming and Scripting
Hi Guys,
Please someone help me to insert these numbers (enclosed with single quotes) to a statement using awk command. I'm having hard time of putting single quotes on these numbers.
input file:
10214
68441
07205
80731
92234
55432
DESIRED OUTPUT:
My ID Number='10214';... (1 Reply)
Discussion started by: pinpe
1 Replies
7. Shell Programming and Scripting
I need to check whether first character of variable is single quote.
I tried the below constructions but they are all not working (always return true)
if (test `echo "$REGEXP" |cut -c1` != "'"); then echo "TRUE"; fi
if (test `echo "$REGEXP" |cut -c1` != '\''); then echo "TRUE"; fi
if (test... (5 Replies)
Discussion started by: urello
5 Replies
8. Shell Programming and Scripting
From:
1,2,3,4,5,This is a test
6,7,8,9,0,"This, is a test"
1,9,2,8,3,"This is a ""test"""
4,7,3,1,8,""""
To:
1,2,3,4,5,This is a test
6,7,8,9,0,"This; is a test"
1,9,2,8,3,"This is a ''test''"
4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies
9. Shell Programming and Scripting
Hi,
I need help in printing string enclosed with single quotes to a file.
I am trying to write a shell script which when run will create another script below is the script logic.
cat create_script.sh
echo '#!/bin/sh' > append_flname.sh
echo 'for FILE in $*' >> append_flname.sh
echo... (6 Replies)
Discussion started by: imrandec85
6 Replies
10. Shell Programming and Scripting
Hello,
I'd like to print line if column 5th doesn't match with exm. But to reach there I have to make sure I match single quote.
I'm struggling to match that.
I've input file like:
Warning: Variants 'exm480340' and '5:137534453:G:C' have the same position.
Warning: Variants 'exm480345'... (9 Replies)
Discussion started by: genome
9 Replies
LEARN ABOUT MOJAVE
lessecho
LESSECHO(1) General Commands Manual LESSECHO(1)
NAME
lessecho - expand metacharacters
SYNOPSIS
lessecho [-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-a] file ...
DESCRIPTION
lessecho is a program that simply echos its arguments on standard output. But any metacharacter in the output is preceded by an "escape"
character, which by default is a backslash.
OPTIONS
A summary of options is included below.
-ex Specifies "x", rather than backslash, to be the escape char for metachars. If x is "-", no escape char is used and arguments con-
taining metachars are surrounded by quotes instead.
-ox Specifies "x", rather than double-quote, to be the open quote character, which is used if the -e- option is specified.
-cx Specifies "x" to be the close quote character.
-pn Specifies "n" to be the open quote character, as an integer.
-dn Specifies "n" to be the close quote character, as an integer.
-mx Specifies "x" to be a metachar. By default, no characters are considered metachars.
-nn Specifies "n" to be a metachar, as an integer.
-fn Specifies "n" to be the escape char for metachars, as an integer.
-a Specifies that all arguments are to be quoted. The default is that only arguments containing metacharacters are quoted
SEE ALSO
less(1)
AUTHOR
This manual page was written by Thomas Schoepf <schoepf@debian.org>, for the Debian GNU/Linux system (but may be used by others).
Send bug reports or comments to bug-less@gnu.org.
Version 487: 25 Oct 2016 LESSECHO(1)