How would one go about deleting the first two characters on each line of a file on Unix? I thought about using awk, but cannot seem to find if it can explicitly do this. In this case there might or might not be a field separator. Meaning that the data might look like this.
01999999999... (5 Replies)
Hi
Is it possible to do the following in a single command
/usr/xpg4/bin/sed -e '/rows selected/d' /aemu/CALLAUTO/callauto.txt > /aemu/CALLAUTO/callautonew.txt
/usr/xpg4/bin/sed -e '/^$/d' /aemu/CALLAUTO/callautonew.txt > /aemu/CALLAUTO/callauto_new.txt
exit (1 Reply)
Hi,
I have a weird requirement. I am having a file with 12fields in it and the end of the line for each record is "\n" (Just \n and no carriage returns) and the field delimiter is "|". Problem is I can have new line characters in any field in the data and these new line characters can even come... (11 Replies)
Hi All,
I am struck with an issue. I need to delete '%' and 'G' from all lines in the input file.
Below is what I want to do.
InputFile
04/09/2012.21:58:17,well9,rootfs,3.9G,2.7G,1.1G,71%,/
04/09/2012.21:58:17,well9,/dev/hda2,3.9G,2.7G,1.1G,71%,/... (6 Replies)
Hi,
I was trying to remove the blank from beginning of a line.
when I try:
sed 's/^ +//' filename
it does not work
but when I try
sed 's/^ *//' filename
it works
But I think the first command should have also replaced any line with one or more blanks.
Kindly help me in understanding... (5 Replies)
I'm trying to delete the blank lines from the file $Sfile. tried the below set of commands. Both are giving the same error (: bad interpreter: No such file or directory)
awk 'NF > 0' $Sfile > $Tfile
cat $Tfile
sed -i '/^$/d' $Sfile
cat $Sfile
Not sure if there's any other problem with... (17 Replies)
Hi All
Need Help
I have a file with the below format (ABC.TXT) :
®¿¿ABCDHEJJSJJ|XCBJSKK01|M|7348974982790
HDFLJDKJSKJ|KJALKSD02|M|7378439274898
KJHSAJKHHJJ|LJDSAJKK03|F|9898982039999
(cont......)
I need to write a script where it will check for : blank lines (between rows,before... (6 Replies)
line(1) General Commands Manual line(1)NAME
line - read one line from user input
SYNOPSIS
timeout]
DESCRIPTION
copies one line (up to a new-line) from the standard input and writes it on the standard output. It returns an exit code of 1 on EOF and
always prints at least a new-line. It is often used within shell files to read from the user's terminal.
Options
recognizes the following command-line option:
Timeout after
timeout seconds where timeout is an integer value (if a non-integer value is specified, it is converted to an integer;
i.e., rounded down). A blank is required between and the timeout argument. This option is not documented in POSIX and
other industry standards, and should not be used in portable applications.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
EXAMPLES
The following lines in a shell script prompt for a file name and display information about the file:
To limit the response time to 10 seconds, use the form:
then test for no response. If no response occurs before timeout expires, a default behavior should be provided.
WARNINGS
This command is likely to be withdrawn from X/Open standards. Applications using this command might not be portable to other vendors' sys-
tems. As an alternative is recommended.
SEE ALSO sh(1), read(2).
STANDARDS CONFORMANCE line(1)