10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
Need help to extract a pattern using sed or cut or any other means.
Input
'name1',1234567890
'name2',2222222222
'name3',3333333333
Expected output
name1,1234567890
name2,2222222222
name3,3333333333 (3 Replies)
Discussion started by: mukulverma2408
3 Replies
2. Shell Programming and Scripting
Hi,
I have long string in 2nd field, as shown below:
REF1 | CLESCLJSCSHSCSMSCSNSCSRSCUDSCUFSCU7SCV1SCWPSCXGPDBACAPA0DHDPDMESED6
REF2 | SBR4PCBFPCDRSCSCG3SCHEBSCKNSCKPSCLLSCMCZXTNPCVFPCV6P4KL0DMDSDSASEWG
I have a group of fixed patterns which can occur in these long strings & only... (11 Replies)
Discussion started by: karumudi7
11 Replies
3. Shell Programming and Scripting
Hi,
I have the following string and I need to extract the date from it:
TextHere,2012/07/11,1
I tried using sed:
sed -n 's#^.*\({4}/{2}/{2}\).*$#\1#p'
But it doesn't return anything. The following line doesn't even return '2012':
sed -n 's/^.*\({4}\).*$/\1/p'
I used to use grep -o... (6 Replies)
Discussion started by: Subbeh
6 Replies
4. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
5. Shell Programming and Scripting
I am working with the ksh shell in HP UNIX and I am attempting to extract a word, beginning with a particular string and ending at the first space. for example I want to extract the word or string MS_RECENT_ACTIVITY from the following string
" This has been entered in MS_RECENT_ACTIVITY the... (2 Replies)
Discussion started by: simpletech369
2 Replies
6. Shell Programming and Scripting
hi all,
i have a file name using the following pattern:
PREFIX: AR
SOURCE: LEGACY
DATETIME: YYYYMMDD_HH24MISS
SUFFIX: .txt
sample filename:
AR_LEGACY_20101104_105500.txt
i want to extract the source which is LEGACY in this case. how do i do this using shell?
thanks. (4 Replies)
Discussion started by: adshocker
4 Replies
7. Shell Programming and Scripting
Hi,
One of the scripts creates logs in the format:
progname_file1.log.20100312020657
where after file the number could be from 1 to 28 and after log. the date is attached in the format YYYYMMDDHHMISS
progname_file<1-28>.log.YYYYMMDDHHMISS.
Now I want to discard the .20100312020657... (7 Replies)
Discussion started by: dips_ag
7 Replies
8. Shell Programming and Scripting
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies
9. Shell Programming and Scripting
Hi All
I have 3 files as listed below and highlighted in bold the portions of the filenames I need to extract:
TOS_TABIN218_20090323.200903231830
TOS_TABIN219_1_20090323.200903231830
TOS_TABIN219_2_20090323.200903231830
I tried
source_tabin_name=`echo $fname | sed 's/_.*//'`
but I... (6 Replies)
Discussion started by: santam
6 Replies
10. Shell Programming and Scripting
I am trying to extract "securitySettings" out of line:
<a ref ="http://localhost:5654/securitySettings">
using sed as follows:
name = `grep "localhost" file.html | sed -n 's/.**\/\(.*)/\">/\1/p'`
But it didn't run, seems have some syntax error. Do anybody knows why?
Thank you very... (11 Replies)
Discussion started by: zhen
11 Replies