To KevinADC: I don't understand why you said "the file is opened for reading not for writing". I thought the ">" symbol means write to file, isn't it?. You confused me there.
To Tyler: Your perl line is brilliant. That's exactly what I'm looking for but I'd rather do that in a Perl script. I'm long way from writing Perl liners.
Hi,
I'm a newbee to Unix shell scripting.
I want to write a shell script that inserts a new String(name&value pair) into a file(s) at a particular place.I willl have to write one script which when executed should insert a new variable in all the files in that particular directory.
Say for eg:... (4 Replies)
Dear all,
I have a file created in the name sample.txt in UNIX with header and footer. How to insert a required string (for example "FILE1") in the header part after the file has been created. What kind of command can i use to do the same.
Thanks in advance
Hari (3 Replies)
:confused:Dears ,
I have text file I need to insert the subscriber number at position 32, and need to keep the next field at position 53 (no increasing of the record lenght), I mean I just want to replace the spaces at position 32 with subscirber number .
for example
A B
A ... (1 Reply)
I am in a dire need of doing this job , please help from shell script or perl script. It will be highly appreciated.
Please have a look at the following INPUT file;
The first 14 rows are not of interest but I want them to be included in the output file as they are. From the row 14... (3 Replies)
I have a tab delimited text file with multiple columns (data.txt). I would like to insert a column into the text file. The column I want to insert is in a text file (column.txt). I want to insert it into the 5th column of data.txt. How do I go about doing that? Thanks! (2 Replies)
Hi all,
I want to create a file and then insert some text into it. I'm trying to create a .sh script that will create a new python file from a template.
Can someone tell me why this won't work,
touch $1 | sed -e '1i\Some test code here'
Sorry I'm quite new to all this!
Just as a side... (3 Replies)
I need to insert text from one file into another file after specific term. I guess sed is the best method of doing this and I can insert a specified text string using this script but I am not sure how to modify it to insert text from another file:
#!/bin/sh
sed 's/\<VirtualHost... (17 Replies)
Hello,
I've been trying to get a script working that fetches weather-data and converts it into an .ics file. The script works so far put I'm stuck at the point where I need to add specific static data. A thorough search through the forum did not point me into the right direction.
#!/bin/bash... (3 Replies)
I'm trying to find a Bourne shell script that will copy files from one directory using a wild card for the file name (*) and add some more characters in the middle of the file name as it is copied. As an example:
/u01/tmp-file1.xml => /u02/tmp-file1-20130620.xml
/u01/tmp-file2.xml => ... (6 Replies)
Hello, I'm trying to take information from a list of hundreds of subject ids (where each line is a new subject id), and insert each line into a new text file that contains the pathnames for each subject.
To clarify, all subject have a similiar path name (e.g., C:\data\SUBJECT_ID\) that contains... (4 Replies)
Discussion started by: invisibledwarf
4 Replies
LEARN ABOUT MOJAVE
tcl_getopenfile
Tcl_GetOpenFile(3) Tcl Library Procedures Tcl_GetOpenFile(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_GetOpenFile - Return a FILE* for a channel registered in the given interpreter (Unix only)
SYNOPSIS
#include <tcl.h>
int
Tcl_GetOpenFile(interp, chanID, write, checkUsage, filePtr)
ARGUMENTS
Tcl_Interp *interp (in) Tcl interpreter from which file handle is to be obtained.
const char *chanID (in) String identifying channel, such as stdin or file4.
int write (in) Non-zero means the file will be used for writing, zero means it will be used for reading.
int checkUsage (in) If non-zero, then an error will be generated if the file was not opened for the access indicated by
write.
ClientData *filePtr (out) Points to word in which to store pointer to FILE structure for the file given by chanID.
_________________________________________________________________DESCRIPTION
Tcl_GetOpenFile takes as argument a file identifier of the form returned by the open command and returns at *filePtr a pointer to the FILE
structure for the file. The write argument indicates whether the FILE pointer will be used for reading or writing. In some cases, such as
a channel that connects to a pipeline of subprocesses, different FILE pointers will be returned for reading and writing. Tcl_GetOpenFile
normally returns TCL_OK. If an error occurs in Tcl_GetOpenFile (e.g. chanID did not make any sense or checkUsage was set and the file was
not opened for the access specified by write) then TCL_ERROR is returned and the interpreter's result will contain an error message. In
the current implementation checkUsage is ignored and consistency checks are always performed.
Note that this interface is only supported on the Unix platform.
KEYWORDS
channel, file handle, permissions, pipeline, read, write
Tcl 8.0 Tcl_GetOpenFile(3)