Thanks for your quick response. My requirement is different.
The file contains text as follows.
The for loop has to read the file line by line and pass the string in each line to the do loop. While reading each line in the file, if the line starts with # or + or - that line should be ignored.
Moderator's Comments:
Please use CODE tags when displaying sample input, sample output, AND code segments.
Last edited by Don Cragun; 06-19-2015 at 02:30 AM..
Reason: Add CODE and ICODE tags.
I have a text file like this with hundreds of lines:
>cat file1.txt
1027123000
1027124000
1127125000
1128140000
1228143000
>
all lines are very similar and have exactly 10 digits. I want to separate the digits by twodigit and hyphens....like so,
>
10-27-12-30-00
10-27-12-40-00... (7 Replies)
Hi Folks,
I got to know from this forums on how to grep from a particular line say line 6
awk 'NR==6 {print;exit}'
But how do i grep from line 6 till the end of the file or command output.
Thanks, (3 Replies)
Hi, I'm trying to do something relatively simple.
I have a txt file that has the following kinds of lines (and many more lines):
CP19 Oahu - Maunawili Falls
CP20 Oahu - Maunawili Falls
AG12 Oahu - Maunawili Falls
CP22 Oahu - Maunawili Falls, Local area
AG14 Oahu
CP141 KZ102 Kauai -... (7 Replies)
Hi All
I have UBUNTU 10.04
I would like to run at command line the gui application that I use for finding network places and navigate shared folders or network driver.
I mean the one located under menu PLACES->NETWORK
I tried using "nautilus" but you need to know in advance which IP to give and... (2 Replies)
Hi
I would just like to ask if there is a way for UNIX to ignore/overcome the 255 character limit of the command line?
My problem is that I have a really long line of text from a file (300+ bytes) which i have to "echo" and process by adding commands like "sed" to the end of the line, like... (5 Replies)
Hello,
I have a command that show some application information. Now, I have to grep there informations, like:
# showlog | grep 1266
1266.1369866124 ::
1266.1304711286 ::
41031.1161812668 ::
41078.1301266480 ::
41641.712662564 ::
1266.333792515 ::
41462.1512661988 ::
1266.54932671... (5 Replies)
In COBOL, a hyphen can be used in a field name and in a specific program some field names would be identical to others except a suffix was added--sometimes a suffix to a suffix was used. For example, assume I am looking for AAA, AAA-BBB, and AAA-BBB-CCC and don't want to look at AAA-BBB-CCC... (7 Replies)
e.g.
File name: File.txt
cat File.txt
Result:
#INBOUND_QUEUE=FAQ1
INBOUND_QUEUE=FAQ2
I want to get the value for one which is not commented out.
Thanks, (3 Replies)
I have a file with a list of references towards the end and want to apply a grep for some string.
text ....
@unnumbered References
@sp 1
@paragraphindent 0
2017. @strong{Chalenski, D.A.}; Wang, K.; Tatanova, Maria; Lopez,
Jorge L.; Hatchell, P.; Dutta, P.; @strong{Small airgun... (1 Reply)
Discussion started by: kristinu
1 Replies
LEARN ABOUT HPUX
fmt
fmt(1) General Commands Manual fmt(1)NAME
fmt - format text
SYNOPSIS
width] [file...]
DESCRIPTION
The command is a simple text formatter that fills and joins lines to produce output lines of (up to) the number of characters specified in
the width option. The default width is 72. concatenates the arguments. If none are given, formats text from the standard input.
Blank lines are preserved in the output, as is the spacing between words. does not fill lines beginning with a period for compatibility
with Nor does it fill lines starting with
Indentation is preserved in the output and input lines with differing indentation are not joined (unless is used).
can also be used as an in-line text filter for the command:
reformats the text between the cursor location and the end of the paragraph.
Options
recognizes the following options:
Crown margin mode.
Preserve the indentation of the first two lines within a paragraph and align the left margin of each subsequent line with that
of the second line. This is useful for tagged paragraphs.
Split lines only.
Do not join short lines to form longer ones. This prevents sample lines of code, and other such "formatted" text, from being
unduly combined.
Fill output lines to up to
width columns.
WARNINGS
The width option is acceptable for BSD compatibility, but it may go away in future releases.
SEE ALSO nroff(1), vi(1).
fmt(1)