10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all,
I would like to insert N blankspaces in front of a string using sed command
To give an example (N=10), I tried that code:
$ echo "abcd" | sed 's/^/ \{10,\}&/'
but I failed, by obtaining that result:
{10,}abcd
Any help would be greatly appreciated,
Thanks in advance,... (18 Replies)
Discussion started by: dae
18 Replies
2. Shell Programming and Scripting
Hello,
I have a text file as:-ABC
BCD
CDF
DEF
EFGI need to convert as 'ABC', 'BCD', 'CDF', 'DEF', 'EFG' using a unix command
anybody can help me out on this.
Regards,
Jas
Please wrap all code, files, input & output/errors in CODE tags.
It makes them easier to read and preserves... (12 Replies)
Discussion started by: jassi10781
12 Replies
3. 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
4. UNIX for Dummies Questions & Answers
Hi All,
I have a set of data as below :
XS012371378 Raj 23-09-12
SH128238948 Andrew 24-08-12
CH273712399 Walsh 12-10-12
JK7249923893 Nick 10-02-13
JP6383791389 Braslin 30-12-13
I want the first column to be extracted separately. I can get this using awk.
awk '{print $1}' file_name
... (3 Replies)
Discussion started by: Nand Kishor
3 Replies
5. Shell Programming and Scripting
I have a file as:
1
New
used
1
used
New
I need o/p as:
'1'
'New'
'used'
'1'
'used'
'New' (12 Replies)
Discussion started by: karumudi7
12 Replies
6. Shell Programming and Scripting
Hi ,
how to add the single digit to front of the word and front of the lines in the one file with compare pattern file and get digit. like example
pattern file pattern.txt
pattern num
bala 2
raja 3
muthu 4
File Name: chennai.dat
muthu is good boy
raja is bad boy
selvam in super... (6 Replies)
Discussion started by: krbala1985
6 Replies
7. Shell Programming and Scripting
Hi I want to replace single quote with two single quotes in a perl string.
If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Discussion started by: DushyantG
3 Replies
8. Shell Programming and Scripting
Hi Experts,
I wish to insert predefined text in front of every line and this needs to be in a loop because it is always expanding.
Before :
11111111
22222222
33333333
44444444
55555555
77777777
88888888
00000000
To be Inserted :
a=
b= (2 Replies)
Discussion started by: masayangbata
2 Replies
9. Shell Programming and Scripting
Hi,
I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file:
Name = "abc"
The regex I'm using to match the same is:
egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies
10. Shell Programming and Scripting
Hi
I have a shell script with many lines as below:
comment on column dcases.proj_seq_num is dcases_1sq;
....
....
I want the above script to be as below:
comment on column dcases.proj_seq_num is 'dcases_1sq';
I want to have single quotes like that as above for the entire shell... (2 Replies)
Discussion started by: dreams5617
2 Replies