The output is WHAT?> is not part of the output, but rather a prompt by your shell ( the $PS2 prompt ) to ask for the next line after you enter a \ followed by enter.. So it is working as expected..
Try redirecting to a file and see for yourself
--
Akshay's solution is working too, just if you used "append" instead of the first record, then it will not work, not because the first non-header record does not contain 1111, but because Akshay's script is testing for extra pipe (|) separated fields as are present in your original sample..
Last edited by Scrutinizer; 04-10-2014 at 03:57 AM..
Hi,
I am trying to use awk to split line before the pattern:
abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890
I need it to be like this:
abcde 12345 67890
abcde 12345 67890
abcde 12345 67890
abcde... (7 Replies)
Hi,
I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest.
when i say
#cat $inputFile | while read eachLine
and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters.
Can you... (1 Reply)
Dear All,
I want to split single line into two line or three lines wherever “|” separated values comes using
Input line
test,DEMTEMPUT20100404010012,,,,,,,,|0070086|0070087,
output shoule be
test,DEMTEMPUT20100404010012,,,,,,,,0070086,
test,DEMTEMPUT20100404010012,,,,,,,,0070087, (14 Replies)
I guess this has a simple solution but can't figure out now.
having:
x="H:a:b:c"
to get H:
echo $x|awk -F: {'print $1'}
how can I put REST of line in another one? i.e.
echo $rest
a:b:c
thanks
---------- Post updated at 08:58 PM ---------- Previous update was at... (5 Replies)
Hi,
I have a file that contains multiple lines e.g.
/Plane/Wing/Engine/Rotorblades
I cannot use print $4 as the directories will be different lengths.
All i would like to do is print the very last column in each line in the file i.e. in this case, Rotorblades.
The code i... (4 Replies)
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Hi All,
Hope you guys had a wonderful weekend
I have a scenario where in which I have to read a file line by line
and check for few words before redirecting to a file
I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
Hi All
Is there a way to export every line into new txt file where by the title of each txt output are same as the line ?
I have this txt files containing names:
Kandra Vanhooser
Rhona Menefee
Reynaldo Hutt
Houston Rafferty
Charmaine Lord
Albertine Poucher
Juana Maes
Mitch Lobel... (2 Replies)
I have a very long line in a file separated by "|" delimiter like below. Due to the length of the line, I find it very difficult to read to find a match line.
file = temp.txt
word 1| word 2 | word 3|....
I would like to read the file temp.txt and print out all words line by line like... (1 Reply)
ED(1) User Commands ED(1)NAME
Ed - line-oriented text editor
SYNOPSIS
ed [options] [file]
DESCRIPTION
GNU Ed - The GNU line editor.
OPTIONS -h, --help
display this help and exit
-V, --version
output version information and exit
-G, --traditional
run in compatibility mode
-l, --loose-exit-status
exit with 0 status even if a command fails
-p, --prompt=STRING
use STRING as an interactive prompt
-r, --restricted
run in restricted mode
-s, --quiet, --silent
suppress diagnostics
-v, --verbose
be verbose
Start edit by reading in 'file' if given. If 'file' begins with a '!', read output of shell command.
Exit status: 0 for a normal exit, 1 for environmental problems (file not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
invalid input file, 3 for an internal consistency error (eg, bug) which caused ed to panic.
REPORTING BUGS
Report bugs to bug-ed@gnu.org
Ed home page: http://www.gnu.org/software/ed/ed.html
General help using GNU software: http://www.gnu.org/gethelp
COPYRIGHT
Copyright (C) 1994 Andrew L. Moore.
Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for Ed is maintained as a Texinfo manual. If the info and Ed programs are properly installed at your site, the com-
mand
info Ed
should give you access to the complete manual.
Ed 1.10 January 2014 ED(1)