Hi all,
I want to write a shell which would allow me to edit a text file or a xml file.
Basically i want to add a new node in a existing xml file. The values for this new node are based on user input.
Thanks in advance
Zing (9 Replies)
Given a text file, how do you add a line of text after a specific line number? I believe I would want to use "sed" but I am unsure of the syntax. Thank you.
Mike (5 Replies)
Dear Friends,
I am beginner in Perl and trying to find the problem in a script. Kindly help me to modify the script. My script is not giving the output for the last field and followed text (LA: Language English). Input file & script as follows:
Input file:
Thu Mar 19 2:34:14 EDT 2009
STC... (3 Replies)
Hi,
I have a text file which is following format -
COL VAL
ABC 1
ABC 2
ABC 3
ABC 4
ABC 5
My requirement is to search for a particular value (provided by user) in the file and comment the previous entries including that as well.
E.g. If I search for number 3, then the output... (6 Replies)
Hi everyone,
I want to know, if there is a way to modify one line in a text file with unix script, with out re-writing all the file.
For example, i have this file:
CONFIGURATION_1=XXXX
CONFIGURATION_2=YYYY
CONFIGURATION_3=ZZZZ
supose i have a command or function "modify" that... (7 Replies)
I have text file with lines as shown here. Each row has 11 columns separated by tab. In each row, i want to split the 8th column such that the output should look like shown below. Here value in the 9th column is DP value and in the 10th column is MQ value followed by the values after resource.EFF=.... (15 Replies)
Hello all,
I have some text files I need to do the following on:
Delete banner page (lines 1-56) --I am doing this using sed
Remove ^M --I am doing this using vi
Remove trailer page --this can vary based on the contents of the file, it usually starts with ***************************
I am... (5 Replies)
Looking for help,
i have input file like below and want to modify to expected output, if can without create additional file, hope can direct modify it.
have 2 thing need do.
1st
is adding a word (testplan generation off) after ! ! IPG: Tue Aug 07 14:31:17 2018
2nd
is adding... (16 Replies)
Discussion started by: kttan
16 Replies
LEARN ABOUT DEBIAN
unblock_dem
UNBLOCK_DEM(1) General Commands Manual UNBLOCK_DEM(1)NAME
unblock_dem - Insert linefeeds into a Digital Elevation Model (DEM) file
SYNOPSIS
unblock_dem [-L]
DESCRIPTION
The drawmap program processes USGS Digital Elevation Model (DEM) files (along with other types of files) to produce customized maps.
Drawmap is able to read these files in their native format. However, since the files usually don't contain any linefeeds, they are diffi-
cult for a human to read. Unblock_dem filters a DEM file and inserts linefeeds for human readability. It takes input from the standard
input and writes to the standard output. The input data must be in uncompressed form, not in gzip-compressed form. Also, unblock_dem does
not work with SDTS DEM files or GTOPO30 files.
Unblock_dem normally takes no options, but, if you use the "-L" option, the program will print out some license information and exit.
Some DEM files already have embedded linefeeds. Unblock_dem makes a feeble attempt to detect these files and abort. If the detection
fails, the results are likely to be garbled, so it is wise to check the format of each file first. The drawmap program, with the "-i"
option, will attempt to tell you whether a file contains linefeeds or not.
The intended use of unblock_dem is simply to let you conveniently examine the files to see what is in them. However, if you are in the
mood for adventure, or if you need to repair a defective file, you can use unblock_dem to make the file easy to edit, then you can edit the
file as desired. Drawmap can still process the files after linefeeds are inserted, but will become confused if any line (including the
linefeed) is more than 1024 characters long. Drawmap may also become confused if you make any significant changes to the format of the
file.
You may be able to use this capability to repair faulty data. However, you need to be familiar with the content and structure of DEM files
in order to do this effectively. You also need to remember that drawmap depends on DEM files having a predictable structure, and it won't
properly parse files that violate this predictability. Do this sort of thing only if you know what you are doing, or if you have a lot of
free time on your hands.
It should be noted that you can obtain a similar effect by using the command recommended by the USGS:
dd if=inputfilename of=outputfilename ibs=4096 cbs=1024 conv=unblock
I prefer the unblock_dem command because it simply replaces the last byte of each record with a linefeed. This lets me easily tell how
long the original records were. The effect of unblock_dem or dd can be undone by typing:
dd if=inputfilename of=outputfilename ibs=4096 cbs=1024 conv=block
You may come across files that have a linefeed in the 1025th byte. Drawmap doesn't like these, both because it can't tell (within the
space of the first 1024-byte record) whether the file contains linefeeds or not, and because the records exceed the maximum record length
of 1024 bytes. You may be able to repair such files by blocking them with the above dd command.
SEE ALSO unblock_dlg(1), drawmap(1)
Jul 24, 2001 UNBLOCK_DEM(1)