08-19-2010
[Solved] Read a line from one string till to another.... Unix scripting..
So i have a file which contains paths to JPG images separated by a space.
I have to separate them each path to another file. So, I have to search all strings that start from /home/ and ends with .jpg or .png
Then write each one to another file...
Can you please help me on doing this???
10 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
Hi ,
I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this.
e.g:-
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS:... (0 Replies)
Discussion started by: adityam
0 Replies
2. Shell Programming and Scripting
Hi ,
I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this.
e.g:-
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid... (1 Reply)
Discussion started by: adityam
1 Replies
3. UNIX for Dummies Questions & Answers
Hi ,
I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this.
e.g:-
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid... (1 Reply)
Discussion started by: adityam
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have reached at a specified offset from the start of file. My requirement is that I want to read only those lines, which have the string READ / ALTER / UPDATE. As soon as, none of these literals are found in the subsequent line, I want to stop reading. Is there any feature of grep which... (1 Reply)
Discussion started by: saurabhsinha23
1 Replies
5. UNIX for Dummies Questions & Answers
Guys - I am new to Unix scripting and am in need for a script that does the following. I have bits and pieces created and tested but i am just having a little difficult time getting it all together.
- Loop through till it finds a string in a specific file.
Any help is greatly appreciated.
... (1 Reply)
Discussion started by: mrehman
1 Replies
6. Shell Programming and Scripting
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies
7. Shell Programming and Scripting
Hi all
Is there a way to read and process a gzip file line by line similar to a text file without using gzcat..
while processing a text file we will usually use the logic
exec<sample.txt
while read line
do
echo $line
done
Is there a similar way to process the gz file in the same... (4 Replies)
Discussion started by: aikhaman
4 Replies
8. Shell Programming and Scripting
Hi all :)
It sounds complex, for example
I want to find the whole html file (there are 5 entries of this string and I need to get all of them) for the string
"<td class="contentheading" width="100%">", get the next line from it only till the point that says "</td>", plus removing \t (tabs)
... (6 Replies)
Discussion started by: hakermania
6 Replies
9. UNIX for Dummies Questions & Answers
Hello All,
i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file.
Any inputs are appreciated
... (3 Replies)
Discussion started by: victor.s
3 Replies
10. Shell Programming and Scripting
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies
DBMERGE(1) DocBook Splitting tools DBMERGE(1)
NAME
dbmerge - merge splited DocBook document
SYNOPSIS
dbmerge [options] input_file [output_file]
dbmerge --help
DESCRIPTION
dbmerge process "xi:include" elements (see <http://www.w3.org/TR/xinclude/>). That is merge splited XML file to one file.
All "xml:base" attributes (see <http://www.w3.org/TR/xmlbase/>) are processed and them removed. Relative references in "fileref" and "url"
attributes are properly rewrited.
If no output file name is specified on command line, output is dumped to standard output and relative references are rewrited as if output
file would be in current work directory.
OPTIONS
--lo-dirs=PATHS
Coma-separated list of paths in which are located local objects (see LOCAL OBJECTS below). All paths are expanded as the standart Unix
shell would do, see File::Glob(3perl) for details. Relative paths is related to curent working directory. If path contains $XML_BASE
at the begining it is replaced by real base of current processing document. Default paths are LocalObjects, MediaObjects, ImageObjects
and #Pictures in base directory of current processing document.
--lo-dirs-add=PATHS
Coma-separeted list of paths which are addeded to preiously specified or the default local objects paths. See --lo-dirs option.
--lo-dir=DIRECTORY
Name of local objects directory for newly created documents (see LOCAL OBJECTS below). Relative path is related to newly created docu-
ments. Default directory is LocalObjects.
--lo-move
Move local objects instead copy them. See LOCAL OBJECTS below.
--xmlbase=URI
XML base URI (Uniform Resource Identifier) for input document. See <http://www.w3.org/TR/xmlbase/> for details. You may need change
default if you simple copy an DocBook document without copying referenced files nor changing "fileref" attributes. On this case set
XML base to orginal location. Note, URI is required not (unix) file name.
-v, --verbose
Increase verbosity level.
-q, --quiet
Decrease verbosity level.
-V, --version
Dump version information and exit.
-h, -?, --help
Dump help screen and exit.
--man
Show this manual page and exit.
LOCAL OBJECTS
Local objects are special files (pictures, audio files, ...) in directories specified by --lo-dirs option. If DocBook document refer (via
"fileref" attribute) to this directory, the files are copied (or moved) to local "Local Objects Directory" specified by --lo-dir option.
Moreower all files with same name and differ suffix (after last dot) are copied (or moved) too.
BUGS AND TODO
o There is no support for attributes "parse" and "encoding" in "xi:include" element yet.
o There is no support for "xi:fallback" element yet.
SEE ALSO
dbautosplit(3), "DocBook: The Definitive Guide" <http://www.docbook.org/tdg/en/html/docbook.html>
AUTHOR
Martin Lazar <mlazar@suse.cz>
0.6 2004-01-27 DBMERGE(1)