You have not specified on what basis, the numbers to be split apart,
if the split is in a random fashion, you could try something like this just expand your selection including the substr
Hi,
I'm using awk and sed to extract some data out from a text file. The text file consists of data over a million (prolly millions) of lines.
Question: Is there a limit of number of lines for awk and sed?
Thanks in advance. (2 Replies)
Hi there,
may someone easily help me on this :
I want to insert a text in a specific line number like :
linenumb2start=`cat memory_map.dld | nl -ba | egrep -i "label" | cut -f1`
line2insert=`expr $linenumb2start + 2`
and now I need to replace something like {} with {comment} at... (8 Replies)
Hi!
I am writing a script handling downloading list of files and I have to check whether file is present locally and if not finished than continue downloading. To do so I have to compare sizes of remote file and local file.
To check remote file size I have to parse something like this:
... (2 Replies)
Alright, I'm sure there's a more efficient way to do this... I'm not an expert by any means. What I'm trying to do is search a file for lines that match the two input words (first name, last name) in order to remove that line. The removal part is what I'm struggling with. Here is my code:
echo... (4 Replies)
hi forums
i need help with a little problem i am having.
i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly.
is there a way of doing this without using SED/AWK?
anything would be greatly appreciated (4 Replies)
sed 's|^xyz.abc *= *.*|xyz.abc=60|' /test/myFile.properties > /test/myFile.properties1
myFile.properties has the last line as xyz.abc=23 does not end with newline.
When I run this command the last line is truncated if there is no newline character at EOF. Looking for an alternative here. (1 Reply)
I Have file1 with below lines :
#HostNameSelection=0 :NotUsed
#HostNameSelection=1 :Automatic
#HostNameSelection=3 :NotForced
I have file2 which has similar lines but with different values
I want to copy the changes from file1 to file2 ,line by line only if line begins with '#'.
for... (7 Replies)
I currently use LaTeX together with a sed script to set cloze test papers for my students. I currently pepend and equals sign to the front of the words I want to leave out in the finished test, =perpendicular, for example. I am able to number the blanks using a variable in LaTeX. I would like to... (8 Replies)
Hi.. I have this delicate problem..:wall: I have this huge ldif file with entry's like this example below..
And I need to change the following entrys.
telephoneNumber:
emNotifNumber:
billingnumber=
BillingNumber:
Al these entrys has a number like 012345678 and it needs to add one more... (15 Replies)
Hello,
I'm writing an Awk script to take a command line argument (student's name) and output their relevant student#, name, and marks. For some reason, awk arbitrarily removes the first digit from the student number and doesn't show me the proper output.
Here is my code:
#! /usr/bin/awk -f... (6 Replies)
Discussion started by: trashmouth12
6 Replies
LEARN ABOUT SUSE
puts
puts(n) Tcl Built-In Commands puts(n)
__________________________________________________________________________________________________________________________________________________NAME
puts - Write to a channel
SYNOPSIS
puts ?-nonewline? ?channelId? string
_________________________________________________________________DESCRIPTION
Writes the characters given by string to the channel given by channelId.
ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdout or stderr), the return value from an invocation
of open or socket, or the result of a channel creation command provided by a Tcl extension. The channel must have been opened for output.
If no channelId is specified then it defaults to stdout. Puts normally outputs a newline character after string, but this feature may be
suppressed by specifying the -nonewline switch.
Newline characters in the output are translated by puts to platform-specific end-of-line sequences according to the current value of the
-translation option for the channel (for example, on PCs newlines are normally replaced with carriage-return-linefeed sequences. See the
fconfigure manual entry for a discussion on ways in which fconfigure will alter output.
Tcl buffers output internally, so characters written with puts may not appear immediately on the output file or device; Tcl will normally
delay output until the buffer is full or the channel is closed. You can force output to appear immediately with the flush command.
When the output buffer fills up, the puts command will normally block until all the buffered data has been accepted for output by the oper-
ating system. If channelId is in nonblocking mode then the puts command will not block even if the operating system cannot accept the
data. Instead, Tcl continues to buffer the data and writes it in the background as fast as the underlying file or device can accept it.
The application must use the Tcl event loop for nonblocking output to work; otherwise Tcl never finds out that the file or device is ready
for more output data. It is possible for an arbitrarily large amount of data to be buffered for a channel in nonblocking mode, which could
consume a large amount of memory. To avoid wasting memory, nonblocking I/O should normally be used in an event-driven fashion with the
fileevent command (do not invoke puts unless you have recently been notified via a file event that the channel is ready for more output
data).
EXAMPLES
Write a short message to the console (or wherever stdout is directed):
puts "Hello, World!"
Print a message in several parts:
puts -nonewline "Hello, "
puts "World!"
Print a message to the standard error channel:
puts stderr "Hello, World!"
Append a log message to a file:
set chan [open my.log a]
set timestamp [clock format [clock seconds]]
puts $chan "$timestamp - Hello, World!"
close $chan
SEE ALSO
file(n), fileevent(n), Tcl_StandardChannels(3)KEYWORDS
channel, newline, output, write
Tcl 7.5 puts(n)