ok i asked around to a few ppl and they said to use sed or awk to do what i want.. but i cant figure out how to use it like that..
anyway i have a text file that is 10k lines long.. i need to move text from the end of a line after the ? and move it to the front of the line then add a | after it.... (3 Replies)
Hello experts,
I ve a text file I want to go to particular line . what is the best way to do this in c ?
I am tried as follows
fseek ( fh, pos, SEEK_SET);
but this functions moves the file pointer according to a number of bytes. Unfortunately I don't know the exact byte... (7 Replies)
Hi,
I have a file called /bb/bin/rstrt.
I need to move the line/entry "ccpm_load_shared_memory" after the entry
"initcorp". The problem is that there are several entries for "initcorp" in this file and I need the entry to be moved only after the first instance of "initcorp"
Is there a way... (5 Replies)
I'm rather new to scripting, and despite my attempts at finding/writing a script to do what I need, I have not yet been successful.
I have a file named "list.txt" of arbitrary length with contents in the following format:
/home/user/Music/file1.mp3
/home/user/Music/file2.mp3... (21 Replies)
I have a folder with about 4000 files in it. I need to extract the files that contain a certain line of text to another directory.
for example files with 'ns1.biz.rr.com' need to be extracted to the directory above or some other directory.
I tried using the following but was not successful. (6 Replies)
Can somebody help me with a script ....
Read a file /etc/inittab
find the string starting with rcml and move it entirely towards the end of file.
rcml:2:once:/usr/sni/aix52/rc.ml > /dev/console 2>&1
I basically want to change the startup sequence. (2 Replies)
I have a script with this statement:
/usr/xpg4/bin/awk -F"" 'NR==FNR{s=$2;next}{printf "%s\"%s\"\n", $0, s}' LOOKUP.TXT finallistnew.txt >test.txt
I want to include logic or an additional step that says if there is no data in field 3, move the whole line out of test.txt into an additional... (9 Replies)
Hi all!
I need some help in changing a text file. I have the following text file:
1,050406259214736,00010,5000,MZM,V050,20131231,EMIG
2,Available,20061126T10:40:15,vs,,
2,Used,20110813T12:32:35,,825351585,1411012901443027
1,050410256649750,00010,5000,MZM,V050,20131231,EMIG
... (2 Replies)
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Hi,
I have a following file and it has only one occurrence of line that says "Output view:". It could be in middle somewhere ( i don't know the exact location ). I want to move it as the first line of the file.
Input
AAA
BBBB
CCCC
Output view:
XXXX
YYYY
ZZZZ
Output should be:
Output... (13 Replies)
Discussion started by: jakSun8
13 Replies
LEARN ABOUT MOJAVE
autouse5.18
autouse(3pm) Perl Programmers Reference Guide autouse(3pm)NAME
autouse - postpone load of modules until a function is used
SYNOPSIS
use autouse 'Carp' => qw(carp croak);
carp "this carp was predeclared and autoused ";
DESCRIPTION
If the module "Module" is already loaded, then the declaration
use autouse 'Module' => qw(func1 func2($;$));
is equivalent to
use Module qw(func1 func2);
if "Module" defines func2() with prototype "($;$)", and func1() has no prototypes. (At least if "Module" uses "Exporter"'s "import",
otherwise it is a fatal error.)
If the module "Module" is not loaded yet, then the above declaration declares functions func1() and func2() in the current package. When
these functions are called, they load the package "Module" if needed, and substitute themselves with the correct definitions.
WARNING
Using "autouse" will move important steps of your program's execution from compile time to runtime. This can
o Break the execution of your program if the module you "autouse"d has some initialization which it expects to be done early.
o hide bugs in your code since important checks (like correctness of prototypes) is moved from compile time to runtime. In particular,
if the prototype you specified on "autouse" line is wrong, you will not find it out until the corresponding function is executed. This
will be very unfortunate for functions which are not always called (note that for such functions "autouse"ing gives biggest win, for a
workaround see below).
To alleviate the second problem (partially) it is advised to write your scripts like this:
use Module;
use autouse Module => qw(carp($) croak(&$));
carp "this carp was predeclared and autoused ";
The first line ensures that the errors in your argument specification are found early. When you ship your application you should comment
out the first line, since it makes the second one useless.
AUTHOR
Ilya Zakharevich (ilya@math.ohio-state.edu)
SEE ALSO perl(1).
perl v5.18.2 2013-11-04 autouse(3pm)