String searching and output to a file in a formatted text
Hi,
I'm very new to UNIX scripting and find quite difficult to understand simple UNIX syntax. Really appreciat if somebody could help me to give simple codes for my below problems:-
1) I need to search for a string "TTOH 8031950001" in a files which filename will be "*host*'. For example, the string I searceh found in below line:-
<Jun 30, 2010 5:06:59 PM GMT+08:00> <DEBUG> <MessageFormatter> {F5380112-1890-3589-1A9E-7F135D382013} sending [ CAMSTTOH TTOH 8031950001 53020001706590000 000001 6 009 21403500125671 ENG AUN CHAN Y 00257600006 ENG AUN CHAN 3445456567 ANANDA KRISHNAN N 100002322 20100630 N N 000000000200000 000000000000200 000000000200200 10125 CAMS21301000007960 10063002024620002 N 000000000000000 ]
(Please consider above is in a single line)
2) The line is too long. I just need Item in the position 2 to 14, Items in {}, sending until end of line. Jun 30, 2010 F5380112-1890-3589-1A9E-7F135D382013 sending [ CAMSTTOH TTOH 8031950001 53020001706590000 000001 6 009 21403500125671 ENG AUN CHAN Y 00257600006 ENG AUN CHAN 3445456567 ANANDA KRISHNAN N 100002322 20100630 N N 000000000200000 000000000000200 000000000200200 10125 CAMS21301000007960 10063002024620002 N 000000000000000 ]
Then, it will be in a formatted text file.
Anyone can help to come out with a script?
Thanks in advance..
Note:-
1)I attached sample of files to be search - batch-host.log.6
2)I attached sample expected output file.
Hi!
I'm new here and glad to meet everyone!
I've been wrestling with a problem lately however! How do I recursively (recursive means to keep going through the subdirectories until no more are there) search a bunch of textfiles in a long directory structure for a specific string.. but only... (1 Reply)
Hi guys, i need your help.
I need to convert a date like this one 20071003071023 , to a formated date
like 20071003 07:10:23 .
Could this be possible ?
Regards,
Osramos (6 Replies)
I have the following output which I need to obtain the values for "Next Seq is xxx" and "Last Seq is xxx" and "Pending count is xxx". You will notice that the number of words prior to that value can be variable hence the reason for asking this question.
LINECMD> Line /xxx///ABC9_SND is UP.... (3 Replies)
Looking for a bit of help. I need to search for a string of words, but unfortunately these words are located on separate lines.
for example the text output is:
United
Chanmpions
Ronaldo
Liverpool
Losers
Torres
and my script code is
print("DEBUG - checking file message");
while... (15 Replies)
Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string.
Previously, I was outputting just each paragraph with that search string with:
cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
hello, i'm a novice on bsh scripting so thanks for any help here
basically i have a shell var $x that looks like this
> echo $x
nabc1234:!:73394:17155:Gary Mason:/home/garym:/bin/ksh
and i'm trying to keep the first 8 characters and the text from the 4th : to the 5th :
i've been trying... (9 Replies)
Hi Forum.
Is there a quick way to do the following search/replace within a block of data? I tried to google the solution but didn't really know what to look for.
I have the following text file (I want to search for a particular string "s_m_f_acct_txn_daily_a1" and replace the... (5 Replies)
without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Hi All,
I want generate HP-UX overall system performance report.
I tried executing top command and write that out put to file. but am not able to view the report in proper format.
I can see report like below in file but i can see properly in terminal.
Please suggest how can i get... (2 Replies)
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Discussion started by: An0mander
2 Replies
LEARN ABOUT SUSE
capisuite
CAPISUITE(8)CAPISUITE(8)NAME
capisuite - Python-scriptable ISDN telecommunication suite
DESCRIPTION
CapiSuite is a Python-scriptable ISDN telecommunication suite. It uses the new CAPI interface for accessing your ISDN-hardware - so you'll
need a card for which a CAPI compatible driver is available. Currently these are all cards manufactured by AVM and some Eicon cards.
This man page only gives a short introduction, for the real documentation please see the HTML or PDF manual distributed with CapiSuite.
CapiSuite tries to give the user the ability to code his own ISDN applications without having to fiddle around with all the dirty program-
ming details like callback functions, data buffers, protocol settings and so on.
I took a scripting language which is (in my opinion) very easy to understand, to use and to learn - especially for beginners: Python. I
extended it with some functions providing the basic ISDN "building blocks" for the users application. Behind these functions the heart of
CapiSuite implements all the dirty details a user isn't interested in. My goal was to make script-coding as simple as possible but to also
give you the flexibility to realize what you want.
To give you an impression, coding a simple answering machine is as easy as:.IP .nf def callIncoming (call, service, call_from, call_to):
connect_voice (call, 10) # answer call after 10 secs audio_send (call, "announcemnt.la") # play announcement audio_send (call, "beep.la") #
play beep audio_receive (call, "call.la", 10) # record call .fi
Of course some details are missing like creating a unique filename or storing the additional information (called and calling party numbers,
time, ...) - but I assume you got my idea.
And - don't be afraid - if you just want to have a normal answering machine or send and receive some fax documents, you can use the default
scripts distributed with CapiSuite. They give you already some nice features - e.g. the answering machine is multi-user ready, supports
automatic fax detection and remote inquiry functions. You'll only need to tell CapiSuite some details like your own number, record an own
announcement and that's it.
So CapiSuite is already equipped for your daily telecommunication needs - but if you don't like to do the things the way I do - just change
it or completely do it on your own. And if you write nice scripts or have changes to my default scripts, I would love to get and perhaps
make them available for all users if you don't mind.
SEE ALSO capisuite.conf(5), fax.conf(5), answering_machine.conf(5), capisuitefax(1)AUTHOR
Gernot Hillier <gernot@hillier.de>.
CAPISUITE(8)