04-23-2009
Hi All,
Currently i have to write a script.
For which i need to cut a block from .txt file.
I know the specific word that starts the block and ends the block.
Can we do it in shell scripting..?
Please suggest....
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all...
I not a expert unix script programmer, Kindly adjust.
My requirement is that, i have a file which contains the about 10 lines -
say
1
2
3
...
8 war of the worlds: => text in this line
9 9000,80,78,77,334,445 => this line contains some numbers separted by commas
10
... (10 Replies)
Discussion started by: cool_boss2121
10 Replies
2. Shell Programming and Scripting
Hi,
how can we search for a word (with case ignore )on specific line numbers
ex:
Awk /^regEX/ with condition on first line or second line
Awk/^ regex1/ on line 1
Awk /^regEX2/ on line 3
thanks in advance (4 Replies)
Discussion started by: rider29
4 Replies
3. UNIX for Dummies Questions & Answers
Hi everyone,
I am attempting to do something that should be very simple. How do I replace a specific line of a file with different text, and then save that file to its original name? I believe I want to use the sed command with the c option, but I after trying many times, I can't get the right... (10 Replies)
Discussion started by: msb65
10 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I am having 100 lines a text file say a.txt. I want read the 'nth' line from that file inside a script. Kindly tell us how to that. (2 Replies)
Discussion started by: boopathyvasagam
2 Replies
5. Shell Programming and Scripting
Say the input was as follows:
Brat 20 x 1000 32rf
Pour 15 p 1621 05pr
Dart 10 z 1111 22xx
My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour"
I currently have this line but it is... (6 Replies)
Discussion started by: Bungkai
6 Replies
6. Shell Programming and Scripting
I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting?
file1.html
<head>
<url>http://www.google.com</url>
</head>
file2.html
<head>... (6 Replies)
Discussion started by: vel4ever
6 Replies
7. Solaris
Hi,
Anyone can help me in Solaris command on how to insert a file at specific line.
I want file1.sql content to be inserted on file2.sh after "recover database using backup controlfile until cancel".
# file1.sql
/archivelogs/927_822338133.arc
/archivelogs/671_822338107.arc... (3 Replies)
Discussion started by: fspalero
3 Replies
8. Shell Programming and Scripting
Hi
This is my first post and I'm just a beginner. So please be nice to me.
I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file?
I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies
9. Shell Programming and Scripting
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies
10. Shell Programming and Scripting
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Discussion started by: teokon90
10 Replies
LEARN ABOUT FREEBSD
archive_write_blocksize
ARCHIVE_WRITE_BLOCKSIZE(3) BSD Library Functions Manual ARCHIVE_WRITE_BLOCKSIZE(3)
NAME
archive_write_get_bytes_per_block, archive_write_set_bytes_per_block, archive_write_get_bytes_in_last_block,
archive_write_set_bytes_in_last_block -- functions for creating archives
LIBRARY
Streaming Archive Library (libarchive, -larchive)
SYNOPSIS
#include <archive.h>
int
archive_write_get_bytes_per_block(struct archive *);
int
archive_write_set_bytes_per_block(struct archive *, int bytes_per_block);
int
archive_write_get_bytes_in_last_block(struct archive *);
int
archive_write_set_bytes_in_last_block(struct archive *, int);
DESCRIPTION
archive_write_set_bytes_per_block()
Sets the block size used for writing the archive data. Every call to the write callback function, except possibly the last one, will
use this value for the length. The default is to use a block size of 10240 bytes. Note that a block size of zero will suppress
internal blocking and cause writes to be sent directly to the write callback as they occur.
archive_write_get_bytes_per_block()
Retrieve the block size to be used for writing. A value of -1 here indicates that the library should use default values. A value of
zero indicates that internal blocking is suppressed.
archive_write_set_bytes_in_last_block()
Sets the block size used for writing the last block. If this value is zero, the last block will be padded to the same size as the
other blocks. Otherwise, the final block will be padded to a multiple of this size. In particular, setting it to 1 will cause the
final block to not be padded. For compressed output, any padding generated by this option is applied only after the compression.
The uncompressed data is always unpadded. The default is to pad the last block to the full block size (note that
archive_write_open_filename() will set this based on the file type). Unlike the other ``set'' functions, this function can be called
after the archive is opened.
archive_write_get_bytes_in_last_block()
Retrieve the currently-set value for last block size. A value of -1 here indicates that the library should use default values.
RETURN VALUES
archive_write_set_bytes_per_block() and archive_write_set_bytes_in_last_block() return ARCHIVE_OK on success, or ARCHIVE_FATAL.
archive_write_get_bytes_per_block() and archive_write_get_bytes_in_last_block() return currently configured block size (-1 indicates the
default block size), or ARCHIVE_FATAL.
ERRORS
Detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions.
SEE ALSO
tar(1), libarchive(3), archive_write_set_options(3), cpio(5), mtree(5), tar(5)
BSD
February 2, 2012 BSD